Skip to content

Commit

Permalink
[video][music] Hide play-related context menu items for party mode pl…
Browse files Browse the repository at this point in the history
…aylists if not existing.
  • Loading branch information
ksooo committed Oct 13, 2023
1 parent 6f2a853 commit 23e6b3b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
8 changes: 8 additions & 0 deletions xbmc/music/MusicUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -894,6 +894,14 @@ bool IsItemPlayable(const CFileItem& item)
}
}

// Check for the partymode playlist item, nothing to play if it does not exist
if (item.IsSmartPlayList() && !CFileUtils::Exists(item.GetPath()))
{
const auto profileManager = CServiceBroker::GetSettingsComponent()->GetProfileManager();
if (item.GetPath() == profileManager->GetUserDataItem("PartyMode.xsp"))
return false;
}

if (item.m_bIsFolder &&
(item.IsMusicDb() || StringUtils::StartsWithNoCase(item.GetPath(), "library://music/")))
{
Expand Down
10 changes: 10 additions & 0 deletions xbmc/video/VideoUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@
#include "guilib/LocalizeStrings.h"
#include "playlists/PlayList.h"
#include "playlists/PlayListFactory.h"
#include "profiles/ProfileManager.h"
#include "settings/MediaSettings.h"
#include "settings/SettingUtils.h"
#include "settings/Settings.h"
#include "settings/SettingsComponent.h"
#include "threads/IRunnable.h"
#include "utils/FileUtils.h"
#include "utils/StringUtils.h"
#include "utils/URIUtils.h"
#include "utils/log.h"
Expand Down Expand Up @@ -574,6 +576,14 @@ bool IsItemPlayable(const CFileItem& item)
}
}

// Check for the partymode playlist item, nothing to play if it does not exist
if (item.IsSmartPlayList() && !CFileUtils::Exists(item.GetPath()))
{
const auto profileManager = CServiceBroker::GetSettingsComponent()->GetProfileManager();
if (item.GetPath() == profileManager->GetUserDataItem("PartyMode-Video.xsp"))
return false;
}

if (item.m_bIsFolder &&
(item.IsVideoDb() || StringUtils::StartsWithNoCase(item.GetPath(), "library://video/")))
{
Expand Down

0 comments on commit 23e6b3b

Please sign in to comment.