Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 21 additions & 5 deletions addons/resource.language.en_gb/resources/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -2192,6 +2192,7 @@ msgctxt "#470"
msgid "Credits"
msgstr ""


#empty strings from id 471 to 473

msgctxt "#474"
Expand Down Expand Up @@ -2389,7 +2390,7 @@ msgctxt "#519"
msgid "Launch in..."
msgstr ""

#empty string with id 520
#: empty string 520

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert to original text


#: xbmc/filesystem/MusicDatabaseDirectory/DirectoryNodeOverview.cpp
msgctxt "#521"
Expand Down Expand Up @@ -8522,7 +8523,17 @@ msgctxt "#15311"
msgid "Path:"
msgstr ""

#empty strings from id 15312 to 15999
#: addons/skin.estuary/xml/Variables.xml
msgctxt "#15312"
msgid "Disc number"
msgstr ""

#: addons/skin.estuary/xml/Variables.xml
msgctxt "#15313"
msgid "Disc title"
msgstr ""

#empty strings from id 15314 to 15999

#: system/settings/settings.xml
msgctxt "#16000"
Expand Down Expand Up @@ -12764,7 +12775,8 @@ msgctxt "#20340"
msgid "Do you want to remove all items within this path from your library?"
msgstr ""

#empty string with id 20341
#: empty string #20341

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert to original text/spaces



#: xbmc/dialogs/GUIDialogMediaFilter.cpp
#: xbmc/dialogs/GUIDialogSmartPlaylistEditor.cpp
Expand Down Expand Up @@ -21145,8 +21157,12 @@ msgctxt "#38073"
msgid "Do you want to refresh information for this item now?"
msgstr ""

#empty strings from id 38074 to 38099
#strings 38074 to 38099 reserved for music library
msgctxt "#38074"
msgid "Box-sets"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Box-sets", "Box sets".... hyphen consistency?

msgstr ""

#empty strings from id 38075 to 38099
#strings 38075 to 38099 reserved for music library

#. Description of section #14200 "Player""
#: system/settings/settings.xml
Expand Down
11 changes: 10 additions & 1 deletion addons/skin.estuary/xml/MusicVisualisation.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,16 @@
<scroll>true</scroll>
</control>
<control type="label">
<top>127</top>
<top>122</top>
<width>1600</width>
<height>40</height>
<label>$INFO[MusicPlayer.DiscTitle,Disc: ,]</label>
<font>40</font>
<shadowcolor>black</shadowcolor>
<scroll>true</scroll>
</control>
<control type="label">
<top>151</top>
<width>1600</width>
<height>40</height>
<label>$INFO[MusicPlayer.TrackNumber,,: ][COLOR=white]$INFO[Player.Title][/COLOR]</label>
Expand Down
2 changes: 1 addition & 1 deletion addons/skin.estuary/xml/Variables.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
<value condition="String.IsEqual(listitem.dbtype,musicvideo) | String.IsEqual(listitem.dbtype,video)">$INFO[ListItem.Genre,[COLOR button_focus]$LOCALIZE[515]: [/COLOR],[CR]]$INFO[ListItem.Plot]</value>
<value condition="String.IsEqual(listitem.dbtype,artist)">$INFO[ListItem.Property(artist_description)]</value>
<value condition="!String.IsEmpty(ListItem.Plot)">$INFO[ListItem.Plot]</value>
<value condition="String.IsEqual(listitem.dbtype,song)">$VAR[MusicTrackInfo,[COLOR button_focus]$LOCALIZE[554]:[/COLOR],[CR]]$INFO[ListItem.Artist,[COLOR button_focus]$LOCALIZE[557]: [/COLOR],[CR]]$INFO[listitem.Album,[COLOR button_focus]$LOCALIZE[558]: [/COLOR],[CR]]$INFO[ListItem.DiscNumber,[COLOR button_focus]$LOCALIZE[427]: [/COLOR],[CR]]$INFO[ListItem.Year,[COLOR button_focus]$LOCALIZE[345]: [/COLOR],[CR]]$INFO[ListItem.Genre,[COLOR button_focus]$LOCALIZE[515]: [/COLOR],[CR]]$INFO[ListItem.Duration,[COLOR button_focus]$LOCALIZE[180]: [/COLOR],[CR]]$INFO[ListItem.Playcount,[COLOR button_focus]$LOCALIZE[567]: [/COLOR],[CR]]</value>
<value condition="String.IsEqual(listitem.dbtype,song)">$VAR[MusicTrackInfo,[COLOR button_focus]$LOCALIZE[554]:[/COLOR],[CR]]$INFO[ListItem.Artist,[COLOR button_focus]$LOCALIZE[557]: [/COLOR],[CR]]$INFO[listitem.Album,[COLOR button_focus]$LOCALIZE[558]: [/COLOR],[CR]]$INFO[ListItem.DiscNumber,[COLOR button_focus]$LOCALIZE[15312]: [/COLOR],[CR]]$INFO[ListItem.DiscTitle,[COLOR button_focus]$LOCALIZE[15313]:[/COLOR],[CR]]$INFO[ListItem.Year,[COLOR button_focus]$LOCALIZE[345]: [/COLOR],[CR]]$INFO[ListItem.Genre,[COLOR button_focus]$LOCALIZE[515]: [/COLOR],[CR]]$INFO[ListItem.Duration,[COLOR button_focus]$LOCALIZE[180]: [/COLOR],[CR]]$INFO[ListItem.Playcount,[COLOR button_focus]$LOCALIZE[567]: [/COLOR],[CR]]</value>
<value>$INFO[ListItem.Genre,[COLOR button_focus]$LOCALIZE[515]: [/COLOR],[CR]]</value>
</variable>
<variable name="MusicTrackInfo">
Expand Down
6 changes: 6 additions & 0 deletions system/library/music/boxsets.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<node order="99" type="folder" visible="Library.HasContent(boxsets)">
<label>Boxsets</label>
<icon>DefaultSets.png</icon>
<path>musicdb://boxsets/</path>
</node>
30 changes: 30 additions & 0 deletions xbmc/GUIInfoManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2520,6 +2520,14 @@ const infomap musicpartymode[] = {{ "enabled", MUSICPM_ENABLED },
/// @skinning_v17 **[New Infolabel]** \link MusicPlayer_DBID `MusicPlayer.DBID`\endlink
/// <p>
/// }
/// \table_row3{ <b>`MusicPlayer.DiscTitle`</b>,
/// \anchor MusicPlayer_DiscTitle
/// _string_,
/// @return The title of the disc currently playing.
/// <p><hr>
/// @skinning_v19 **[New Infolabel]** \link MusicPlayer_DiscTitle `MusicPlayer.DiscTitle`\endlink
/// <p>
/// }
/// \table_end
///
/// -----------------------------------------------------------------------------
Expand All @@ -2540,6 +2548,8 @@ const infomap musicplayer[] = {{ "title", MUSICPLAYER_TITLE },
{ "samplerate", MUSICPLAYER_SAMPLERATE },
{ "codec", MUSICPLAYER_CODEC },
{ "discnumber", MUSICPLAYER_DISC_NUMBER },
{ "disctitle", MUSICPLAYER_DISC_TITLE },
{ "isboxset", MUSICPLAYER_IS_BOXSET },
{ "rating", MUSICPLAYER_RATING },
{ "ratingandvotes", MUSICPLAYER_RATING_AND_VOTES },
{ "userrating", MUSICPLAYER_USER_RATING },
Expand Down Expand Up @@ -5717,6 +5727,14 @@ const infomap container_str[] = {{ "property", CONTAINER_PROPERTY },
/// @skinning_v19 **[New Infolabel]** \link ListItem_CurrentItem `ListItem.CurrentItem`\endlink
/// <p>
/// }
/// \table_row3{ <b>`ListItem.DiscTitle`</b>,
/// \anchor ListItem_DiscTitle
/// _string_,
/// @return The disc title of the currently selected album or song.
/// <p><hr>
/// @skinning_v19 **[New Infolabel]** \link ListItem_DiscTitle `ListItem.DiscTitle`\endlink
/// <p>
/// }
/// \table_end
///
/// -----------------------------------------------------------------------------
Expand All @@ -5736,6 +5754,8 @@ const infomap listitem_labels[]= {{ "thumb", LISTITEM_THUMB },
{ "contributors", LISTITEM_CONTRIBUTORS },
{ "contributorandrole", LISTITEM_CONTRIBUTOR_AND_ROLE },
{ "director", LISTITEM_DIRECTOR },
{ "disctitle", LISTITEM_DISC_TITLE },
{ "isboxset", LISTITEM_IS_BOXSET },
{ "filename", LISTITEM_FILENAME },
{ "filenameandpath", LISTITEM_FILENAME_AND_PATH },
{ "fileextension", LISTITEM_FILE_EXTENSION },
Expand Down Expand Up @@ -8455,6 +8475,14 @@ const infomap slideshow[] = {{ "ispaused", SLIDESHOW_ISPAUSED
/// @skinning_v17 **[New Boolean Condition]** \link Library_HasContent_Role_Mixer `Library.HasContent(Role.Mixer)`\endlink
/// <p>
/// }
/// \table_row3{ <b>`Library.HasContent(boxsets)`</b>,
/// \anchor Library_HasContent_Boxsets
/// _boolean_,
/// @return **True** if there are albums in the library which are boxsets.
/// <p><hr>
/// @skinning_v19 **[New Boolean Condition]** \link Library_HasContent_Boxsets `Library.HasContent(boxsets)`\endlink
/// <p>
/// }
/// \table_end
///
/// -----------------------------------------------------------------------------
Expand Down Expand Up @@ -8869,6 +8897,8 @@ int CGUIInfoManager::TranslateSingleString(const std::string &strCondition, bool
return LIBRARY_HAS_SINGLES;
else if (cat == "compilations")
return LIBRARY_HAS_COMPILATIONS;
else if (cat == "boxsets")
return LIBRARY_HAS_BOXSETS;
else if (cat == "role" && prop.num_params() > 1)
return AddMultiInfo(CGUIInfo(LIBRARY_HAS_ROLE, prop.param(1), 0));
}
Expand Down
8 changes: 6 additions & 2 deletions xbmc/filesystem/MusicDatabaseDirectory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ bool CMusicDatabaseDirectory::IsAllItem(const std::string& strDirectory)
bool CMusicDatabaseDirectory::GetLabel(const std::string& strDirectory, std::string& strLabel)
{
strLabel = "";

std::string path = CLegacyPathTranslation::TranslateMusicDbPath(strDirectory);
std::unique_ptr<CDirectoryNode> pNode(CDirectoryNode::ParseURL(path));
if (!pNode.get())
Expand Down Expand Up @@ -207,14 +206,16 @@ bool CMusicDatabaseDirectory::GetLabel(const std::string& strDirectory, std::str
case NODE_TYPE_ALBUM_COMPILATIONS_SONGS:
strLabel = g_localizeStrings.Get(521);
break;
case NODE_TYPE_BOXSETS:
strLabel = g_localizeStrings.Get(38074); // box-sets
break;
case NODE_TYPE_OVERVIEW:
strLabel = "";
break;
default:
return false;
}
}

return true;
}

Expand All @@ -229,6 +230,7 @@ bool CMusicDatabaseDirectory::ContainsSongs(const std::string &path)
if (type == MUSICDATABASEDIRECTORY::NODE_TYPE_ALBUM_TOP100_SONGS) return true;
if (type == MUSICDATABASEDIRECTORY::NODE_TYPE_SONG_TOP100) return true;
if (type == MUSICDATABASEDIRECTORY::NODE_TYPE_YEAR_SONG) return true;
if (type == MUSICDATABASEDIRECTORY::NODE_TYPE_BOXSET_DISC_SONGS) return true;
return false;
}

Expand Down Expand Up @@ -290,6 +292,8 @@ std::string CMusicDatabaseDirectory::GetIcon(const std::string &strDirectory)
return "DefaultMusicTop100Songs.png";
case NODE_TYPE_YEAR:
return "DefaultMusicYears.png";
case NODE_TYPE_BOXSETS:
return "DefaultSets.png";
case NODE_TYPE_ALBUM_COMPILATIONS:
return "DefaultMusicCompilations.png";
default:
Expand Down
6 changes: 6 additions & 0 deletions xbmc/filesystem/MusicDatabaseDirectory/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ set(SOURCES DirectoryNodeAlbumCompilations.cpp
DirectoryNodeAlbumTop100.cpp
DirectoryNodeAlbumTop100Song.cpp
DirectoryNodeArtist.cpp
DirectoryNodeBoxsets.cpp
DirectoryNodeBoxsetDiscs.cpp
DirectoryNodeBoxsetDiscSongs.cpp
DirectoryNode.cpp
DirectoryNodeGrouped.cpp
DirectoryNodeOverview.cpp
Expand All @@ -31,6 +34,9 @@ set(HEADERS DirectoryNode.h
DirectoryNodeAlbumTop100.h
DirectoryNodeAlbumTop100Song.h
DirectoryNodeArtist.h
DirectoryNodeBoxsets.h
DirectoryNodeBoxsetDiscs.h
DirectoryNodeBoxsetDiscSongs.h
DirectoryNodeGrouped.h
DirectoryNodeOverview.h
DirectoryNodeRoot.h
Expand Down
9 changes: 9 additions & 0 deletions xbmc/filesystem/MusicDatabaseDirectory/DirectoryNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
#include "DirectoryNodeAlbumTop100.h"
#include "DirectoryNodeAlbumTop100Song.h"
#include "DirectoryNodeArtist.h"
#include "DirectoryNodeBoxsets.h"
#include "DirectoryNodeBoxsetDiscs.h"
#include "DirectoryNodeBoxsetDiscSongs.h"
#include "DirectoryNodeGrouped.h"
#include "DirectoryNodeOverview.h"
#include "DirectoryNodeRoot.h"
Expand Down Expand Up @@ -102,6 +105,12 @@ CDirectoryNode* CDirectoryNode::CreateNode(NODE_TYPE Type, const std::string& st
case NODE_TYPE_ROLE:
case NODE_TYPE_YEAR:
return new CDirectoryNodeGrouped(Type, strName, pParent);
case NODE_TYPE_BOXSETS:
return new CDirectoryNodeBoxsets(strName, pParent);
case NODE_TYPE_BOXSET_DISCS:
return new CDirectoryNodeBoxsetDiscs(strName, pParent);
case NODE_TYPE_BOXSET_DISC_SONGS:
return new CDirectoryNodeBoxsetDiscSongs(strName, pParent);
case NODE_TYPE_ARTIST:
return new CDirectoryNodeArtist(strName, pParent);
case NODE_TYPE_ALBUM:
Expand Down
7 changes: 4 additions & 3 deletions xbmc/filesystem/MusicDatabaseDirectory/DirectoryNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ namespace XFILE
NODE_TYPE_YEAR,
NODE_TYPE_YEAR_ALBUM,
NODE_TYPE_YEAR_SONG,
NODE_TYPE_SINGLES
NODE_TYPE_SINGLES,
NODE_TYPE_BOXSETS,
NODE_TYPE_BOXSET_DISCS,
NODE_TYPE_BOXSET_DISC_SONGS
} NODE_TYPE;

typedef struct {
Expand Down Expand Up @@ -90,5 +93,3 @@ namespace XFILE
};
}
}


Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* Copyright (C) 2005-2018 Team Kodi
* This file is part of Kodi - https://kodi.tv
*
* SPDX-License-Identifier: GPL-2.0-or-later
* See LICENSES/README.md for more information.
*/

#include "DirectoryNodeBoxsetDiscSongs.h"

#include "QueryParams.h"
#include "guilib/LocalizeStrings.h"
#include "music/MusicDatabase.h"

using namespace XFILE::MUSICDATABASEDIRECTORY;

CDirectoryNodeBoxsetDiscSongs::CDirectoryNodeBoxsetDiscSongs(const std::string& strName, CDirectoryNode* pParent)
: CDirectoryNode(NODE_TYPE_BOXSET_DISC_SONGS, strName, pParent)
{

}

NODE_TYPE CDirectoryNodeBoxsetDiscSongs::GetChildType() const
{
return NODE_TYPE_BOXSET_DISC_SONGS;
}
std::string CDirectoryNodeBoxsetDiscSongs::GetLocalizedName() const
{

if (GetID() == -1)
return g_localizeStrings.Get(15102); // All Albums
return "";
}

bool CDirectoryNodeBoxsetDiscSongs::GetContent(CFileItemList& items) const
{
CMusicDatabase musicdatabase;
if (!musicdatabase.Open())
return false;

CQueryParams params;
CollectQueryParams(params);

bool bSuccess=musicdatabase.GetBoxsetDiscSongs(BuildPath(), items);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this method and node doing that is different from CDirectoryNodeSong?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah well, I guess I could ask you what's the difference between CDirectoryNodeSong and CDirectoryAlbumCompilationSongs because I don't think that is needed either. You shouldn't need the "compilations" flag when getting the songs as all the albums in items are already compilations and thus returning the songs for each album is enough. I've tested that funnily enough and it works fine.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes exactly, CDirectoryAlbumCompilationSongs is historic and superseded.
Understandably you followed how compilations nodes had been done for boxed sets, but it was an outdated approach.

musicdatabase.Close();

return bSuccess;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Copyright (C) 2005-2018 Team Kodi
* This file is part of Kodi - https://kodi.tv
*
* SPDX-License-Identifier: GPL-2.0-or-later
* See LICENSES/README.md for more information.
*/

#pragma once

#include "DirectoryNode.h"

namespace XFILE
{
namespace MUSICDATABASEDIRECTORY
{
class CDirectoryNodeBoxsetDiscSongs : public CDirectoryNode
{
public:
CDirectoryNodeBoxsetDiscSongs(const std::string& strName, CDirectoryNode* pParent);
protected:
NODE_TYPE GetChildType() const override;
bool GetContent(CFileItemList& items) const override;
std::string GetLocalizedName() const override;
};
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* Copyright (C) 2005-2018 Team Kodi
* This file is part of Kodi - https://kodi.tv
*
* SPDX-License-Identifier: GPL-2.0-or-later
* See LICENSES/README.md for more information.
*/

#include "DirectoryNodeBoxsetDiscs.h"

#include "QueryParams.h"
#include "guilib/LocalizeStrings.h"
#include "music/MusicDatabase.h"

using namespace XFILE::MUSICDATABASEDIRECTORY;

CDirectoryNodeBoxsetDiscs::CDirectoryNodeBoxsetDiscs(const std::string& strName, CDirectoryNode* pParent)
: CDirectoryNode(NODE_TYPE_BOXSET_DISCS, strName, pParent)
{

}

NODE_TYPE CDirectoryNodeBoxsetDiscs::GetChildType() const
{
return NODE_TYPE_BOXSET_DISC_SONGS;
}

std::string CDirectoryNodeBoxsetDiscs::GetLocalizedName() const
{

if (GetID() == -1)
return g_localizeStrings.Get(15102); // All Albums
return "";
}

bool CDirectoryNodeBoxsetDiscs::GetContent(CFileItemList& items) const
{
CMusicDatabase musicdatabase;
if (!musicdatabase.Open())
return false;

CQueryParams params;
CollectQueryParams(params);

bool bSuccess=musicdatabase.GetBoxsetDiscs(BuildPath(), items, params.GetAlbumId());

musicdatabase.Close();

return bSuccess;
}
Loading