<coordinates>
<system>1</system>
<posx>240</posx>
- <posy>45</posy>
+ <posy>22</posy>
</coordinates>
<include>dialogeffect</include>
<controls>
<posx>0</posx>
<posy>0</posy>
<width>800</width>
- <height>630</height>
+ <height>675</height>
<texture border="40">DialogBack.png</texture>
</control>
<control type="image">
<onright>19</onright>
<onleft>19</onleft>
<onup>17</onup>
- <ondown>9001</ondown>
+ <ondown>23</ondown>
</control>
<control type="togglebutton" id="19">
<onright>18</onright>
<onleft>18</onleft>
<onup>17</onup>
+ <ondown>24</ondown>
+ </control>
+
+ <control type="spincontrolex" id="23">
+ <posx>30</posx>
+ <posy>530</posy>
+ <width>550</width>
+ <height>40</height>
+ <label>21458</label>
+ <font>font13</font>
+ <texturefocus border="5">button-focus2.png</texturefocus>
+ <texturenofocus border="5">button-nofocus.png</texturenofocus>
+ <onright>24</onright>
+ <onleft>24</onleft>
+ <onup>18</onup>
+ <ondown>9001</ondown>
+ </control>
+
+ <control type="radiobutton" id="24">
+ <posx>590</posx>
+ <posy>530</posy>
+ <width>180</width>
+ <height>40</height>
+ <font>font12_title</font>
+ <align>center</align>
+ <aligny>center</aligny>
+ <texturenofocus border="5">button-nofocus.png</texturenofocus>
+ <texturefocus border="5">button-focus.png</texturefocus>
+ <label>21459</label>
+ <onright>23</onright>
+ <onleft>23</onleft>
+ <onup>19</onup>
<ondown>9001</ondown>
</control>
+
<control type="group" id="9001">
<control type="button" id="20">
<description>Ok Button</description>
<posx>195</posx>
- <posy>560</posy>
+ <posy>605</posy>
<width>200</width>
<height>40</height>
<align>center</align>
<aligny>center</aligny>
<label>186</label>
<font>font12_title</font>
- <onup>18</onup>
+ <onup>23</onup>
<onleft>21</onleft>
<onright>21</onright>
<ondown>22</ondown>
<control type="button" id="21">
<description>Cancel Button</description>
<posx>405</posx>
- <posy>560</posy>
+ <posy>605</posy>
<width>200</width>
<height>40</height>
<align>center</align>
<aligny>center</aligny>
<label>222</label>
<font>font12_title</font>
- <onup>18</onup>
+ <onup>23</onup>
<onleft>20</onleft>
<onright>20</onright>
<ondown>22</ondown>
msgid "Writer"
msgstr ""
-#empty string with id 20418
+#: xbmc/playlists/SmartPlayList.cpp
+msgctxt "#20418"
+msgid "Writers"
+msgstr ""
#: xbmc/settings/GUISettings.cpp
msgctxt "#20419"
msgid "Watched episode count"
msgstr ""
-#empty strings from id 21458 to 21459
+msgctxt "#21458"
+msgid "Group by"
+msgstr ""
+
+msgctxt "#21459"
+msgid "mixed"
+msgstr ""
#: xbmc/settings/GUISettings.cpp
msgctxt "#21460"
<ClCompile Include="..\..\xbmc\filesystem\MultiPathDirectory.cpp" />
<ClCompile Include="..\..\xbmc\filesystem\MultiPathFile.cpp" />
<ClCompile Include="..\..\xbmc\filesystem\MusicDatabaseDirectory.cpp" />
+ <ClCompile Include="..\..\xbmc\filesystem\MusicDatabaseDirectory\DirectoryNodeGrouped.cpp" />
<ClCompile Include="..\..\xbmc\filesystem\MusicDatabaseFile.cpp" />
<ClCompile Include="..\..\xbmc\filesystem\MusicFileDirectory.cpp" />
<ClCompile Include="..\..\xbmc\filesystem\MusicSearchDirectory.cpp" />
<ClCompile Include="..\..\xbmc\filesystem\UPnPDirectory.cpp" />
<ClCompile Include="..\..\xbmc\filesystem\UPnPFile.cpp" />
<ClCompile Include="..\..\xbmc\filesystem\VideoDatabaseDirectory.cpp" />
- <ClCompile Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeCountry.cpp" />
- <ClCompile Include="..\..\xbmc\filesystem\VideoDatabaseDirectory\DirectoryNodeTags.cpp" />
+ <ClCompile Include="..\..\xbmc\filesystem\VideoDatabaseDirectory\DirectoryNodeGrouped.cpp" />
<ClCompile Include="..\..\xbmc\filesystem\windows\WINFileSMB.cpp" />
<ClCompile Include="..\..\xbmc\filesystem\windows\WINSMBDirectory.cpp" />
<ClCompile Include="..\..\xbmc\filesystem\VirtualDirectory.cpp" />
<ClInclude Include="..\..\xbmc\filesystem\DAVCommon.h" />
<ClInclude Include="..\..\xbmc\filesystem\DAVFile.h" />
<ClInclude Include="..\..\xbmc\filesystem\ImageFile.h" />
- <ClInclude Include="..\..\xbmc\filesystem\VideoDatabaseDirectory\DirectoryNodeTags.h" />
+ <ClInclude Include="..\..\xbmc\filesystem\MusicDatabaseDirectory\DirectoryNodeGrouped.h" />
+ <ClInclude Include="..\..\xbmc\filesystem\VideoDatabaseDirectory\DirectoryNodeGrouped.h" />
<ClInclude Include="..\..\xbmc\filesystem\windows\WINFileSMB.h" />
<ClInclude Include="..\..\xbmc\filesystem\windows\WINSMBDirectory.h" />
<ClInclude Include="..\..\xbmc\guilib\cximage.h" />
<ClCompile Include="..\..\xbmc\FileSystem\MusicDatabaseDirectory\DirectoryNodeAlbumTop100.cpp" />
<ClCompile Include="..\..\xbmc\FileSystem\MusicDatabaseDirectory\DirectoryNodeAlbumTop100Song.cpp" />
<ClCompile Include="..\..\xbmc\FileSystem\MusicDatabaseDirectory\DirectoryNodeArtist.cpp" />
- <ClCompile Include="..\..\xbmc\FileSystem\MusicDatabaseDirectory\DirectoryNodeGenre.cpp" />
<ClCompile Include="..\..\xbmc\FileSystem\MusicDatabaseDirectory\DirectoryNodeOverview.cpp" />
<ClCompile Include="..\..\xbmc\FileSystem\MusicDatabaseDirectory\DirectoryNodeRoot.cpp" />
<ClCompile Include="..\..\xbmc\FileSystem\MusicDatabaseDirectory\DirectoryNodeSingles.cpp" />
<ClCompile Include="..\..\xbmc\FileSystem\MusicDatabaseDirectory\DirectoryNodeSong.cpp" />
<ClCompile Include="..\..\xbmc\FileSystem\MusicDatabaseDirectory\DirectoryNodeSongTop100.cpp" />
<ClCompile Include="..\..\xbmc\FileSystem\MusicDatabaseDirectory\DirectoryNodeTop100.cpp" />
- <ClCompile Include="..\..\xbmc\FileSystem\MusicDatabaseDirectory\DirectoryNodeYear.cpp">
- <ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug (DirectX)|Win32'">$(IntDir)%(Filename)1.obj</ObjectFileName>
- <ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">$(IntDir)%(Filename)1.obj</ObjectFileName>
- <ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug (OpenGL)|Win32'">$(IntDir)%(Filename)1.obj</ObjectFileName>
- <ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Release (DirectX)|Win32'">$(IntDir)%(Filename)1.obj</ObjectFileName>
- <ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Release (OpenGL)|Win32'">$(IntDir)%(Filename)1.obj</ObjectFileName>
- </ClCompile>
<ClCompile Include="..\..\xbmc\FileSystem\MusicDatabaseDirectory\DirectoryNodeYearAlbum.cpp" />
<ClCompile Include="..\..\xbmc\FileSystem\MusicDatabaseDirectory\DirectoryNodeYearSong.cpp" />
<ClCompile Include="..\..\xbmc\FileSystem\MusicDatabaseDirectory\QueryParams.cpp" />
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Release (DirectX)|Win32'">$(IntDir)%(Filename)1.obj</ObjectFileName>
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Release (OpenGL)|Win32'">$(IntDir)%(Filename)1.obj</ObjectFileName>
</ClCompile>
- <ClCompile Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeActor.cpp" />
- <ClCompile Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeDirector.cpp" />
<ClCompile Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeEpisodes.cpp" />
- <ClCompile Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeGenre.cpp">
- <ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug (DirectX)|Win32'">$(IntDir)%(Filename)1.obj</ObjectFileName>
- <ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">$(IntDir)%(Filename)1.obj</ObjectFileName>
- <ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug (OpenGL)|Win32'">$(IntDir)%(Filename)1.obj</ObjectFileName>
- <ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Release (DirectX)|Win32'">$(IntDir)%(Filename)1.obj</ObjectFileName>
- <ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Release (OpenGL)|Win32'">$(IntDir)%(Filename)1.obj</ObjectFileName>
- </ClCompile>
<ClCompile Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeMoviesOverview.cpp" />
- <ClCompile Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeMusicVideoAlbum.cpp" />
<ClCompile Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeMusicVideosOverview.cpp" />
<ClCompile Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeOverview.cpp">
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug (DirectX)|Win32'">$(IntDir)%(Filename)1.obj</ObjectFileName>
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Release (OpenGL)|Win32'">$(IntDir)%(Filename)1.obj</ObjectFileName>
</ClCompile>
<ClCompile Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeSeasons.cpp" />
- <ClCompile Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeSets.cpp" />
- <ClCompile Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeStudio.cpp" />
<ClCompile Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeTitleMovies.cpp" />
<ClCompile Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeTitleMusicVideos.cpp" />
<ClCompile Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeTitleTvShows.cpp" />
<ClCompile Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeTvShowsOverview.cpp" />
- <ClCompile Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeYear.cpp" />
<ClCompile Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\QueryParams.cpp">
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug (DirectX)|Win32'">$(IntDir)%(Filename)1.obj</ObjectFileName>
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">$(IntDir)%(Filename)1.obj</ObjectFileName>
<ClInclude Include="..\..\xbmc\FileItem.h" />
<ClInclude Include="..\..\xbmc\filesystem\PVRDirectory.h" />
<ClInclude Include="..\..\xbmc\filesystem\PVRFile.h" />
- <ClInclude Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeCountry.h" />
<ClInclude Include="..\..\xbmc\GUIInfoManager.h" />
<ClInclude Include="..\..\xbmc\GUILargeTextureManager.h" />
<ClInclude Include="..\..\xbmc\guilib\AnimatedGif.h" />
<ClInclude Include="..\..\xbmc\FileSystem\MusicDatabaseDirectory\DirectoryNodeAlbumTop100.h" />
<ClInclude Include="..\..\xbmc\FileSystem\MusicDatabaseDirectory\DirectoryNodeAlbumTop100Song.h" />
<ClInclude Include="..\..\xbmc\FileSystem\MusicDatabaseDirectory\DirectoryNodeArtist.h" />
- <ClInclude Include="..\..\xbmc\FileSystem\MusicDatabaseDirectory\DirectoryNodeGenre.h" />
<ClInclude Include="..\..\xbmc\FileSystem\MusicDatabaseDirectory\DirectoryNodeOverview.h" />
<ClInclude Include="..\..\xbmc\FileSystem\MusicDatabaseDirectory\DirectoryNodeRoot.h" />
<ClInclude Include="..\..\xbmc\FileSystem\MusicDatabaseDirectory\DirectoryNodeSingles.h" />
<ClInclude Include="..\..\xbmc\FileSystem\MusicDatabaseDirectory\DirectoryNodeSong.h" />
<ClInclude Include="..\..\xbmc\FileSystem\MusicDatabaseDirectory\DirectoryNodeSongTop100.h" />
<ClInclude Include="..\..\xbmc\FileSystem\MusicDatabaseDirectory\DirectoryNodeTop100.h" />
- <ClInclude Include="..\..\xbmc\FileSystem\MusicDatabaseDirectory\DirectoryNodeYear.h" />
<ClInclude Include="..\..\xbmc\FileSystem\MusicDatabaseDirectory\DirectoryNodeYearAlbum.h" />
<ClInclude Include="..\..\xbmc\FileSystem\MusicDatabaseDirectory\DirectoryNodeYearSong.h" />
<ClInclude Include="..\..\xbmc\FileSystem\MusicDatabaseDirectory\QueryParams.h" />
<ClInclude Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNode.h" />
- <ClInclude Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeActor.h" />
- <ClInclude Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeDirector.h" />
<ClInclude Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeEpisodes.h" />
- <ClInclude Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeGenre.h" />
<ClInclude Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeMoviesOverview.h" />
- <ClInclude Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeMusicVideoAlbum.h" />
<ClInclude Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeMusicVideosOverview.h" />
<ClInclude Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeOverview.h" />
<ClInclude Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeRecentlyAddedEpisodes.h" />
<ClInclude Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeRecentlyAddedMusicVideos.h" />
<ClInclude Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeRoot.h" />
<ClInclude Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeSeasons.h" />
- <ClInclude Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeSets.h" />
- <ClInclude Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeStudio.h" />
<ClInclude Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeTitleMovies.h" />
<ClInclude Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeTitleMusicVideos.h" />
<ClInclude Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeTitleTvShows.h" />
<ClInclude Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeTvShowsOverview.h" />
- <ClInclude Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeYear.h" />
<ClInclude Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\QueryParams.h" />
<ClInclude Include="..\..\xbmc\addons\Addon.h" />
<ClInclude Include="..\..\xbmc\addons\AddonDll.h" />
<ClCompile Include="..\..\xbmc\FileSystem\MusicDatabaseDirectory\DirectoryNodeArtist.cpp">
<Filter>filesystem\MusicDatabaseDirectory</Filter>
</ClCompile>
- <ClCompile Include="..\..\xbmc\FileSystem\MusicDatabaseDirectory\DirectoryNodeGenre.cpp">
- <Filter>filesystem\MusicDatabaseDirectory</Filter>
- </ClCompile>
<ClCompile Include="..\..\xbmc\FileSystem\MusicDatabaseDirectory\DirectoryNodeOverview.cpp">
<Filter>filesystem\MusicDatabaseDirectory</Filter>
</ClCompile>
<ClCompile Include="..\..\xbmc\FileSystem\MusicDatabaseDirectory\DirectoryNodeTop100.cpp">
<Filter>filesystem\MusicDatabaseDirectory</Filter>
</ClCompile>
- <ClCompile Include="..\..\xbmc\FileSystem\MusicDatabaseDirectory\DirectoryNodeYear.cpp">
- <Filter>filesystem\MusicDatabaseDirectory</Filter>
- </ClCompile>
<ClCompile Include="..\..\xbmc\FileSystem\MusicDatabaseDirectory\DirectoryNodeYearAlbum.cpp">
<Filter>filesystem\MusicDatabaseDirectory</Filter>
</ClCompile>
<ClCompile Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNode.cpp">
<Filter>filesystem\VideoDatabaseDirectory</Filter>
</ClCompile>
- <ClCompile Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeActor.cpp">
- <Filter>filesystem\VideoDatabaseDirectory</Filter>
- </ClCompile>
- <ClCompile Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeDirector.cpp">
- <Filter>filesystem\VideoDatabaseDirectory</Filter>
- </ClCompile>
<ClCompile Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeEpisodes.cpp">
<Filter>filesystem\VideoDatabaseDirectory</Filter>
</ClCompile>
- <ClCompile Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeGenre.cpp">
- <Filter>filesystem\VideoDatabaseDirectory</Filter>
- </ClCompile>
<ClCompile Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeMoviesOverview.cpp">
<Filter>filesystem\VideoDatabaseDirectory</Filter>
</ClCompile>
- <ClCompile Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeMusicVideoAlbum.cpp">
- <Filter>filesystem\VideoDatabaseDirectory</Filter>
- </ClCompile>
<ClCompile Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeMusicVideosOverview.cpp">
<Filter>filesystem\VideoDatabaseDirectory</Filter>
</ClCompile>
<ClCompile Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeSeasons.cpp">
<Filter>filesystem\VideoDatabaseDirectory</Filter>
</ClCompile>
- <ClCompile Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeSets.cpp">
- <Filter>filesystem\VideoDatabaseDirectory</Filter>
- </ClCompile>
- <ClCompile Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeStudio.cpp">
- <Filter>filesystem\VideoDatabaseDirectory</Filter>
- </ClCompile>
<ClCompile Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeTitleMovies.cpp">
<Filter>filesystem\VideoDatabaseDirectory</Filter>
</ClCompile>
<ClCompile Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeTvShowsOverview.cpp">
<Filter>filesystem\VideoDatabaseDirectory</Filter>
</ClCompile>
- <ClCompile Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeYear.cpp">
- <Filter>filesystem\VideoDatabaseDirectory</Filter>
- </ClCompile>
<ClCompile Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\QueryParams.cpp">
<Filter>filesystem\VideoDatabaseDirectory</Filter>
</ClCompile>
<ClCompile Include="..\..\xbmc\addons\Skin.cpp">
<Filter>addons</Filter>
</ClCompile>
- <ClCompile Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeCountry.cpp">
- <Filter>filesystem\VideoDatabaseDirectory</Filter>
- </ClCompile>
<ClCompile Include="..\..\xbmc\addons\PluginSource.cpp">
<Filter>addons</Filter>
</ClCompile>
<ClCompile Include="..\..\xbmc\music\karaoke\karaokevideobackground.cpp">
<Filter>music\karaoke</Filter>
</ClCompile>
- <ClCompile Include="..\..\xbmc\filesystem\VideoDatabaseDirectory\DirectoryNodeTags.cpp">
- <Filter>filesystem\VideoDatabaseDirectory</Filter>
- </ClCompile>
<ClCompile Include="..\..\xbmc\utils\EdenVideoArtUpdater.cpp">
<Filter>utils</Filter>
</ClCompile>
<ClCompile Include="..\..\xbmc\video\PlayerController.cpp">
<Filter>video</Filter>
</ClCompile>
+ <ClCompile Include="..\..\xbmc\filesystem\VideoDatabaseDirectory\DirectoryNodeGrouped.cpp">
+ <Filter>filesystem\VideoDatabaseDirectory</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\xbmc\filesystem\MusicDatabaseDirectory\DirectoryNodeGrouped.cpp">
+ <Filter>filesystem\MusicDatabaseDirectory</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\xbmc\win32\pch.h">
<ClInclude Include="..\..\xbmc\FileSystem\MusicDatabaseDirectory\DirectoryNodeArtist.h">
<Filter>filesystem\MusicDatabaseDirectory</Filter>
</ClInclude>
- <ClInclude Include="..\..\xbmc\FileSystem\MusicDatabaseDirectory\DirectoryNodeGenre.h">
- <Filter>filesystem\MusicDatabaseDirectory</Filter>
- </ClInclude>
<ClInclude Include="..\..\xbmc\FileSystem\MusicDatabaseDirectory\DirectoryNodeOverview.h">
<Filter>filesystem\MusicDatabaseDirectory</Filter>
</ClInclude>
<ClInclude Include="..\..\xbmc\FileSystem\MusicDatabaseDirectory\DirectoryNodeTop100.h">
<Filter>filesystem\MusicDatabaseDirectory</Filter>
</ClInclude>
- <ClInclude Include="..\..\xbmc\FileSystem\MusicDatabaseDirectory\DirectoryNodeYear.h">
- <Filter>filesystem\MusicDatabaseDirectory</Filter>
- </ClInclude>
<ClInclude Include="..\..\xbmc\FileSystem\MusicDatabaseDirectory\DirectoryNodeYearAlbum.h">
<Filter>filesystem\MusicDatabaseDirectory</Filter>
</ClInclude>
<ClInclude Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNode.h">
<Filter>filesystem\VideoDatabaseDirectory</Filter>
</ClInclude>
- <ClInclude Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeActor.h">
- <Filter>filesystem\VideoDatabaseDirectory</Filter>
- </ClInclude>
- <ClInclude Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeDirector.h">
- <Filter>filesystem\VideoDatabaseDirectory</Filter>
- </ClInclude>
<ClInclude Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeEpisodes.h">
<Filter>filesystem\VideoDatabaseDirectory</Filter>
</ClInclude>
- <ClInclude Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeGenre.h">
- <Filter>filesystem\VideoDatabaseDirectory</Filter>
- </ClInclude>
<ClInclude Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeMoviesOverview.h">
<Filter>filesystem\VideoDatabaseDirectory</Filter>
</ClInclude>
- <ClInclude Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeMusicVideoAlbum.h">
- <Filter>filesystem\VideoDatabaseDirectory</Filter>
- </ClInclude>
<ClInclude Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeMusicVideosOverview.h">
<Filter>filesystem\VideoDatabaseDirectory</Filter>
</ClInclude>
<ClInclude Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeSeasons.h">
<Filter>filesystem\VideoDatabaseDirectory</Filter>
</ClInclude>
- <ClInclude Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeSets.h">
- <Filter>filesystem\VideoDatabaseDirectory</Filter>
- </ClInclude>
- <ClInclude Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeStudio.h">
- <Filter>filesystem\VideoDatabaseDirectory</Filter>
- </ClInclude>
<ClInclude Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeTitleMovies.h">
<Filter>filesystem\VideoDatabaseDirectory</Filter>
</ClInclude>
<ClInclude Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeTvShowsOverview.h">
<Filter>filesystem\VideoDatabaseDirectory</Filter>
</ClInclude>
- <ClInclude Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeYear.h">
- <Filter>filesystem\VideoDatabaseDirectory</Filter>
- </ClInclude>
<ClInclude Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\QueryParams.h">
<Filter>filesystem\VideoDatabaseDirectory</Filter>
</ClInclude>
<ClInclude Include="..\..\xbmc\addons\Skin.h">
<Filter>addons</Filter>
</ClInclude>
- <ClInclude Include="..\..\xbmc\FileSystem\VideoDatabaseDirectory\DirectoryNodeCountry.h">
- <Filter>filesystem\VideoDatabaseDirectory</Filter>
- </ClInclude>
<ClInclude Include="..\..\xbmc\cdrip\DllFlacEnc.h">
<Filter>cores\paplayer</Filter>
</ClInclude>
<ClInclude Include="..\..\xbmc\utils\ISortable.h">
<Filter>utils</Filter>
</ClInclude>
- <ClInclude Include="..\..\xbmc\filesystem\VideoDatabaseDirectory\DirectoryNodeTags.h">
- <Filter>filesystem\VideoDatabaseDirectory</Filter>
- </ClInclude>
<ClInclude Include="..\..\xbmc\guilib\GUIKeyboard.h">
<Filter>guilib</Filter>
</ClInclude>
<ClInclude Include="..\..\xbmc\video\PlayerController.h">
<Filter>video</Filter>
</ClInclude>
+ <ClInclude Include="..\..\xbmc\filesystem\VideoDatabaseDirectory\DirectoryNodeGrouped.h">
+ <Filter>filesystem\VideoDatabaseDirectory</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\xbmc\filesystem\MusicDatabaseDirectory\DirectoryNodeGrouped.h">
+ <Filter>filesystem\MusicDatabaseDirectory</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\..\xbmc\win32\XBMC_PC.rc">
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
-<node order="4" type="folder">
+<node order="4" type="filter">
<label>344</label>
- <path>videodb://1/4</path>
<icon>DefaultActor.png</icon>
+ <content>movies</content>
+ <group>actors</group>
</node>
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
-<node order="8" type="folder">
+<node order="8" type="filter">
<label>20451</label>
- <path>videodb://1/8</path>
<icon>DefaultCountry.png</icon>
+ <content>movies</content>
+ <group>countries</group>
</node>
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
-<node order="5" type="folder">
+<node order="5" type="filter">
<label>20348</label>
- <path>videodb://1/5</path>
<icon>DefaultDirector.png</icon>
+ <content>movies</content>
+ <group>directors</group>
</node>
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
-<node order="1" type="folder">
+<node order="1" type="filter">
<label>135</label>
- <path>videodb://1/1</path>
<icon>DefaultGenre.png</icon>
+ <content>movies</content>
+ <group>genres</group>
</node>
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
-<node order="7" type="folder" visible="Library.HasContent(MovieSets)">
+<node order="7" type="filter" visible="Library.HasContent(MovieSets)">
<label>20434</label>
- <path>videodb://1/7</path>
<icon>DefaultSets.png</icon>
+ <content>movies</content>
+ <group>sets</group>
</node>
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
-<node order="6" type="folder">
+<node order="6" type="filter">
<label>20388</label>
- <path>videodb://1/6</path>
<icon>DefaultStudios.png</icon>
+ <content>movies</content>
+ <group>studios</group>
</node>
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
-<node order="9" type="folder">
+<node order="9" type="filter">
<label>20459</label>
- <path>videodb://1/9</path>
<icon>DefaultTags.png</icon>
+ <content>movies</content>
+ <group>tags</group>
</node>
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
-<node order="2" type="folder">
+<node order="2" type="filter">
<label>369</label>
- <path>videodb://1/2</path>
<icon>DefaultMovieTitle.png</icon>
+ <content>movies</content>
+ <order direction="ascending">sorttitle</order>
</node>
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
-<node order="3" type="folder">
+<node order="3" type="filter">
<label>562</label>
- <path>videodb://1/3</path>
<icon>DefaultYear.png</icon>
+ <content>movies</content>
+ <group>years</group>
</node>
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
-<node order="5" type="folder">
+<node order="5" type="filter">
<label>132</label>
- <path>videodb://3/5</path>
<icon>DefaultAlbum.png</icon>
+ <content>musicvideos</content>
+ <group>albums</group>
</node>
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
-<node order="4" type="folder">
+<node order="4" type="filter">
<label>133</label>
- <path>videodb://3/4</path>
<icon>DefaultArtist.png</icon>
+ <content>musicvideos</content>
+ <group>artists</group>
</node>
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
-<node order="6" type="folder">
+<node order="6" type="filter">
<label>20348</label>
- <path>videodb://3/6</path>
<icon>DefaultDirector.png</icon>
+ <content>musicvideos</content>
+ <group>directors</group>
</node>
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
-<node order="1" type="folder">
+<node order="1" type="filter">
<label>135</label>
- <path>videodb://3/1</path>
<icon>DefaultGenre.png</icon>
+ <content>musicvideos</content>
+ <group>genres</group>
</node>
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
-<node order="7" type="folder">
+<node order="7" type="filter">
<label>20388</label>
- <path>videodb://3/7</path>
<icon>DefaultStudios.png</icon>
+ <content>musicvideos</content>
+ <group>studios</group>
</node>
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
-<node order="8" type="folder">
+<node order="8" type="filter">
<label>20459</label>
- <path>videodb://3/9</path>
<icon>DefaultTags.png</icon>
+ <content>musicvideos</content>
+ <group>tags</group>
</node>
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
-<node order="2" type="folder">
+<node order="2" type="filter">
<label>369</label>
- <path>videodb://3/2</path>
<icon>DefaultMusicVideoTitle.png</icon>
+ <content>musicvideos</content>
+ <order direction="ascending">title</order>
</node>
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
-<node order="3" type="folder">
+<node order="3" type="filter">
<label>562</label>
- <path>videodb://3/3</path>
<icon>DefaultYear.png</icon>
+ <content>musicvideos</content>
+ <group>years</group>
</node>
<node order="11" type="folder" visible="Library.HasContent(TVShows)">
<label>20387</label>
<icon>DefaultRecentlyAddedEpisodes.png</icon>
- <path>videodb://5</path>
+ <path>videodb://recentlyaddedepisodes/</path>
</node>
<node order="10" type="folder" visible="Library.HasContent(Movies)">
<label>20386</label>
<icon>DefaultRecentlyAddedMovies.png</icon>
- <path>videodb://4</path>
+ <path>videodb://recentlyaddedmovies/</path>
</node>
<node order="12" type="folder" visible="Library.HasContent(MusicVideos)">
<label>20390</label>
<icon>DefaultRecentlyAddedMusicVideos.png</icon>
- <path>videodb://6</path>
+ <path>videodb://recentlyaddedmusicvideos/</path>
</node>
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
-<node order="4" type="folder">
+<node order="4" type="filter">
<label>344</label>
- <path>videodb://2/4</path>
<icon>DefaultActor.png</icon>
+ <content>tvshows</content>
+ <group>actors</group>
</node>
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
-<node order="1" type="folder">
+<node order="1" type="filter">
<label>135</label>
- <path>videodb://2/1</path>
<icon>DefaultGenre.png</icon>
+ <content>tvshows</content>
+ <group>genres</group>
</node>
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
-<node order="5" type="folder">
+<node order="5" type="filter">
<label>20388</label>
- <path>videodb://2/5</path>
<icon>DefaultStudios.png</icon>
+ <content>tvshows</content>
+ <group>studios</group>
</node>
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
-<node order="6" type="folder">
+<node order="6" type="filter">
<label>20459</label>
- <path>videodb://2/9</path>
<icon>DefaultTags.png</icon>
+ <content>tvshows</content>
+ <group>tags</group>
</node>
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
-<node order="2" type="folder">
+<node order="2" type="filter">
<label>369</label>
- <path>videodb://2/2</path>
<icon>DefaultTVShowTitle.png</icon>
+ <content>tvshows</content>
+ <order direction="ascending">sorttitle</order>
</node>
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
-<node order="3" type="folder">
+<node order="3" type="filter">
<label>562</label>
- <path>videodb://2/3</path>
<icon>DefaultYear.png</icon>
+ <content>tvshows</content>
+ <group>years</group>
</node>
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
-<node order="1" type="folder" visible="Library.HasContent(Movies)">
+<node order="1" type="filter" visible="Library.HasContent(Movies)">
<label>342</label>
- <path>videodb://1/2</path>
<icon>DefaultMovies.png</icon>
+ <content>movies</content>
+ <order direction="ascending">sorttitle</order>
</node>
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
-<node order="3" type="folder" visible="Library.HasContent(MusicVideos)">
+<node order="3" type="filter" visible="Library.HasContent(MusicVideos)">
<label>20389</label>
- <path>videodb://3/2</path>
<icon>DefaultMusicVideos.png</icon>
+ <content>musicvideos</content>
+ <order direction="ascending">title</order>
</node>
<node order="11" type="folder" visible="Library.HasContent(TVShows)">
<label>20387</label>
<icon>DefaultRecentlyAddedEpisodes.png</icon>
- <path>videodb://5</path>
+ <path>videodb://recentlyaddedepisodes/</path>
</node>
<node order="10" type="folder" visible="Library.HasContent(Movies)">
<label>20386</label>
<icon>DefaultRecentlyAddedMovies.png</icon>
- <path>videodb://4</path>
+ <path>videodb://recentlyaddedmovies/</path>
</node>
<node order="12" type="folder" visible="Library.HasContent(MusicVideos)">
<label>20390</label>
<icon>DefaultRecentlyAddedMusicVideos.png</icon>
- <path>videodb://6</path>
+ <path>videodb://recentlyaddedmusicvideos/</path>
</node>
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
-<node order="2" type="folder" visible="Library.HasContent(TVShows)">
+<node order="2" type="filter" visible="Library.HasContent(TVShows)">
<label>20343</label>
- <path>videodb://2/2</path>
<icon>DefaultTVShows.png</icon>
+ <content>tvshows</content>
+ <order direction="ascending">sorttitle</order>
</node>
sqlWhereMusic[sqlWhereMusic.size() - 1] = ')'; // replace the last comma with closing bracket
CMusicDatabase database;
database.Open();
- database.GetSongsByWhere("musicdb://4/", sqlWhereMusic, items);
+ database.GetSongsByWhere("musicdb://songs/", sqlWhereMusic, items);
}
if (sqlWhereVideo.size() > 19)
{
sqlWhereVideo[sqlWhereVideo.size() - 1] = ')'; // replace the last comma with closing bracket
CVideoDatabase database;
database.Open();
- database.GetMusicVideosByWhere("videodb://3/2/", sqlWhereVideo, items);
+ database.GetMusicVideosByWhere("videodb://musicvideos/titles/", sqlWhereVideo, items);
}
m_history = chosenSongIDs;
#define CONTROL_LIMIT 17
#define CONTROL_ORDER_FIELD 18
#define CONTROL_ORDER_DIRECTION 19
+#define CONTROL_GROUP_BY 23
+#define CONTROL_GROUP_MIXED 24
#define CONTROL_OK 20
#define CONTROL_CANCEL 21
OnOrderDirection();
else if (iControl == CONTROL_TYPE)
OnType();
+ else if (iControl == CONTROL_GROUP_BY)
+ OnGroupBy();
+ else if (iControl == CONTROL_GROUP_MIXED)
+ OnGroupMixed();
else
return CGUIDialog::OnMessage(message);
return true;
UpdateButtons();
}
+void CGUIDialogSmartPlaylistEditor::OnGroupBy()
+{
+ CGUIMessage msg(GUI_MSG_ITEM_SELECTED, GetID(), CONTROL_GROUP_BY);
+ OnMessage(msg);
+ m_playlist.SetGroup(CSmartPlaylistRule::TranslateGroup((Field)msg.GetParam1()));
+
+ if (m_playlist.IsGroupMixed() && !CSmartPlaylistRule::CanGroupMix((Field)msg.GetParam1()))
+ m_playlist.SetGroupMixed(false);
+
+ UpdateButtons();
+}
+
+void CGUIDialogSmartPlaylistEditor::OnGroupMixed()
+{
+ m_playlist.SetGroupMixed(!m_playlist.IsGroupMixed());
+ UpdateButtons();
+}
+
void CGUIDialogSmartPlaylistEditor::UpdateButtons()
{
CONTROL_ENABLE(CONTROL_OK); // always enabled since we can have no rules -> match everything (as we do with default partymode playlists)
CGUIMessage msg(GUI_MSG_ITEM_SELECT, GetID(), CONTROL_ORDER_FIELD, m_playlist.m_orderField);
OnMessage(msg);
}
+
+ // setup groups
+ {
+ CGUIMessage msg(GUI_MSG_LABEL_RESET, GetID(), CONTROL_GROUP_BY);
+ OnMessage(msg);
+ }
+ vector<Field> groups = CSmartPlaylistRule::GetGroups(m_playlist.GetType());
+ Field currentGroup = CSmartPlaylistRule::TranslateGroup(m_playlist.GetGroup());
+ for (unsigned int i = 0; i < groups.size(); i++)
+ {
+ CGUIMessage msg(GUI_MSG_LABEL_ADD, GetID(), CONTROL_GROUP_BY, groups[i]);
+ msg.SetLabel(CSmartPlaylistRule::GetLocalizedGroup(groups[i]));
+ OnMessage(msg);
+ }
+ {
+ CGUIMessage msg(GUI_MSG_ITEM_SELECT, GetID(), CONTROL_GROUP_BY, currentGroup);
+ OnMessage(msg);
+ }
+
+ if (m_playlist.IsGroupMixed())
+ CONTROL_SELECT(CONTROL_GROUP_MIXED);
+ else
+ CONTROL_DESELECT(CONTROL_GROUP_MIXED);
+
+ // disable the group controls if there's no group
+ // or only one group which can't be mixed
+ if (groups.size() == 0 ||
+ (groups.size() == 1 && !CSmartPlaylistRule::CanGroupMix(groups[0])))
+ {
+ CONTROL_DISABLE(CONTROL_GROUP_BY);
+ CONTROL_DISABLE(CONTROL_GROUP_MIXED);
+ }
+ else
+ {
+ CONTROL_ENABLE(CONTROL_GROUP_BY);
+ CONTROL_ENABLE_ON_CONDITION(CONTROL_GROUP_MIXED, CSmartPlaylistRule::CanGroupMix(currentGroup));
+ }
}
void CGUIDialogSmartPlaylistEditor::UpdateRuleControlButtons()
void CGUIDialogSmartPlaylistEditor::OnInitWindow()
{
m_cancelled = false;
- UpdateButtons();
SendMessage(GUI_MSG_ITEM_SELECT, CONTROL_LIMIT, m_playlist.m_limit);
SendMessage(GUI_MSG_ITEM_SELECT, CONTROL_TYPE, type);
m_playlist.SetType(ConvertType(type));
+ UpdateButtons();
CGUIDialog::OnInitWindow();
}
void OnType();
void OnOrder();
void OnOrderDirection();
+ void OnGroupBy();
+ void OnGroupMixed();
void OnOK();
void OnCancel();
void UpdateButtons();
VIDEODB_CONTENT_TYPE type = VIDEODB_CONTENT_MOVIES;
if (m_type.Equals("movies"))
- basePath += "1/";
+ basePath += "movies/";
else if (m_type.Equals("tvshows"))
{
type = VIDEODB_CONTENT_TVSHOWS;
- basePath += "2/";
+ basePath += "tvshows/";
}
else if (m_type.Equals("musicvideos"))
{
type = VIDEODB_CONTENT_MUSICVIDEOS;
- basePath += "3/";
+ basePath += "musicvideos/";
}
else if (m_type.Equals("episodes"))
{
type = VIDEODB_CONTENT_TVSHOWS;
else
type = VIDEODB_CONTENT_EPISODES;
- basePath += "2/";
+ basePath += "tvshows/";
}
int iLabel = 0;
if (m_rule.m_field == FieldGenre)
{
if (m_type.Equals("tvshows") || m_type.Equals("episodes") || m_type.Equals("movies"))
- videodatabase.GetGenresNav(basePath + "1/", items, type);
+ videodatabase.GetGenresNav(basePath + "genres/", items, type);
else if (m_type.Equals("songs") || m_type.Equals("albums") || m_type.Equals("artists") || m_type.Equals("mixed"))
- database.GetGenresNav("musicdb://1/",items);
+ database.GetGenresNav("musicdb://genres/",items);
if (m_type.Equals("musicvideos") || m_type.Equals("mixed"))
{
CFileItemList items2;
- videodatabase.GetGenresNav("videodb://3/1/",items2,VIDEODB_CONTENT_MUSICVIDEOS);
+ videodatabase.GetGenresNav("videodb://musicvideos/genres/",items2,VIDEODB_CONTENT_MUSICVIDEOS);
items.Append(items2);
}
iLabel = 515;
else if (m_rule.m_field == FieldArtist || m_rule.m_field == FieldAlbumArtist)
{
if (m_type.Equals("songs") || m_type.Equals("mixed") || m_type.Equals("albums") || m_type.Equals("artists"))
- database.GetArtistsNav("musicdb://2/", items, m_rule.m_field == FieldAlbumArtist, -1);
+ database.GetArtistsNav("musicdb://artists/", items, m_rule.m_field == FieldAlbumArtist, -1);
if (m_type.Equals("musicvideos") || m_type.Equals("mixed"))
{
CFileItemList items2;
else if (m_rule.m_field == FieldAlbum)
{
if (m_type.Equals("songs") || m_type.Equals("mixed") || m_type.Equals("albums"))
- database.GetAlbumsNav("musicdb://3/", items);
+ database.GetAlbumsNav("musicdb://albums/", items);
if (m_type.Equals("musicvideos") || m_type.Equals("mixed"))
{
CFileItemList items2;
}
else if (m_rule.m_field == FieldActor)
{
- videodatabase.GetActorsNav(basePath + "4/",items,type);
+ videodatabase.GetActorsNav(basePath + "actors/",items,type);
iLabel = 20337;
}
else if (m_rule.m_field == FieldYear)
{
if (m_type.Equals("songs") || m_type.Equals("mixed") || m_type.Equals("albums"))
- database.GetYearsNav("musicdb://9/", items);
+ database.GetYearsNav("musicdb://years/", items);
if (!m_type.Equals("songs") && !m_type.Equals("albums"))
{
CFileItemList items2;
- videodatabase.GetYearsNav(basePath + "3/", items2, type);
+ videodatabase.GetYearsNav(basePath + "years/", items2, type);
items.Append(items2);
}
iLabel = 562;
}
else if (m_rule.m_field == FieldDirector)
{
- videodatabase.GetDirectorsNav(basePath + "5/", items, type);
+ videodatabase.GetDirectorsNav(basePath + "directors/", items, type);
iLabel = 20339;
}
else if (m_rule.m_field == FieldStudio)
{
- if (m_type.Equals("movies"))
- basePath += "6/";
- else if (m_type.Equals("musicvideos") || m_type.Equals("mixed"))
- basePath += "7/";
- else
- basePath += "5/";
-
- videodatabase.GetStudiosNav(basePath, items, type);
+ videodatabase.GetStudiosNav(basePath + "studios/", items, type);
iLabel = 572;
}
else if (m_rule.m_field == FieldWriter)
else if (m_rule.m_field == FieldTvShowTitle ||
(m_type.Equals("tvshows") && m_rule.m_field == FieldTitle))
{
- videodatabase.GetTvShowsNav(basePath + "2/", items);
+ videodatabase.GetTvShowsNav(basePath + "titles/", items);
iLabel = 20343;
}
else if (m_rule.m_field == FieldTitle)
{
if (m_type.Equals("songs"))
{
- database.GetSongsNav("musicdb://4/", items, -1, -1, -1);
+ database.GetSongsNav("musicdb://songs/", items, -1, -1, -1);
iLabel = 134;
}
else if (m_type.Equals("movies"))
{
- videodatabase.GetMoviesNav(basePath + "2/", items);
+ videodatabase.GetMoviesNav(basePath + "titles/", items);
iLabel = 20342;
}
else if (m_type.Equals("episodes"))
{
- videodatabase.GetEpisodesNav(basePath + "2/-1/-1/", items);
+ videodatabase.GetEpisodesNav(basePath + "titles/-1/-1/", items);
// we need to replace the db label (<season>x<episode> <title>) with the title only
CLabelFormatter format("%T", "");
for (int i = 0; i < items.Size(); i++)
}
else if (m_type.Equals("musicvideos"))
{
- videodatabase.GetMusicVideosNav(basePath + "2/", items);
+ videodatabase.GetMusicVideosNav(basePath + "titles/", items);
iLabel = 20389;
}
else
}
else if (m_rule.m_field == FieldSet)
{
- videodatabase.GetSetsNav("videodb://1/7/", items, VIDEODB_CONTENT_MOVIES);
+ videodatabase.GetSetsNav("videodb://movies/sets/", items, VIDEODB_CONTENT_MOVIES);
iLabel = 20434;
}
else if (m_rule.m_field == FieldTag)
else if (m_type != "movies")
return;
- videodatabase.GetTagsNav(basePath + "9/", items, type);
+ videodatabase.GetTagsNav(basePath + "tags/", items, type);
iLabel = 20459;
}
else
#include "QueryParams.h"
#include "DirectoryNodeRoot.h"
#include "DirectoryNodeOverview.h"
-#include "DirectoryNodeGenre.h"
+#include "DirectoryNodeGrouped.h"
#include "DirectoryNodeArtist.h"
#include "DirectoryNodeAlbum.h"
#include "DirectoryNodeSong.h"
#include "DirectoryNodeAlbumTop100Song.h"
#include "DirectoryNodeAlbumCompilations.h"
#include "DirectoryNodeAlbumCompilationsSongs.h"
-#include "DirectoryNodeYear.h"
#include "DirectoryNodeYearAlbum.h"
#include "DirectoryNodeYearSong.h"
#include "DirectoryNodeSingles.h"
case NODE_TYPE_OVERVIEW:
return new CDirectoryNodeOverview(strName, pParent);
case NODE_TYPE_GENRE:
- return new CDirectoryNodeGenre(strName, pParent);
+ case NODE_TYPE_YEAR:
+ return new CDirectoryNodeGrouped(Type, strName, pParent);
case NODE_TYPE_ARTIST:
return new CDirectoryNodeArtist(strName, pParent);
case NODE_TYPE_ALBUM:
return new CDirectoryNodeAlbumCompilations(strName, pParent);
case NODE_TYPE_ALBUM_COMPILATIONS_SONGS:
return new CDirectoryNodeAlbumCompilationsSongs(strName, pParent);
- case NODE_TYPE_YEAR:
- return new CDirectoryNodeYear(strName, pParent);
case NODE_TYPE_YEAR_ALBUM:
return new CDirectoryNodeYearAlbum(strName, pParent);
case NODE_TYPE_YEAR_SONG:
} NODE_TYPE;
typedef struct {
- NODE_TYPE node;
- int id;
- int label;
+ NODE_TYPE node;
+ std::string id;
+ int label;
} Node;
class CDirectoryNode
+++ /dev/null
-/*
- * Copyright (C) 2005-2013 Team XBMC
- * http://www.xbmc.org
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- */
-
-#include "DirectoryNodeGenre.h"
-#include "QueryParams.h"
-#include "music/MusicDatabase.h"
-
-using namespace XFILE::MUSICDATABASEDIRECTORY;
-
-CDirectoryNodeGenre::CDirectoryNodeGenre(const CStdString& strName, CDirectoryNode* pParent)
- : CDirectoryNode(NODE_TYPE_GENRE, strName, pParent)
-{
-
-}
-
-NODE_TYPE CDirectoryNodeGenre::GetChildType() const
-{
- return NODE_TYPE_ARTIST;
-}
-
-CStdString CDirectoryNodeGenre::GetLocalizedName() const
-{
- CMusicDatabase db;
- if (db.Open())
- return db.GetGenreById(GetID());
- return "";
-}
-
-bool CDirectoryNodeGenre::GetContent(CFileItemList& items) const
-{
- CMusicDatabase musicdatabase;
- if (!musicdatabase.Open())
- return false;
-
- CQueryParams params;
- CollectQueryParams(params);
-
- bool bSuccess=musicdatabase.GetGenresNav(BuildPath(), items);
-
- musicdatabase.Close();
-
- return bSuccess;
-}
+++ /dev/null
-#pragma once
-/*
- * Copyright (C) 2005-2013 Team XBMC
- * http://www.xbmc.org
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- */
-
-#include "DirectoryNode.h"
-
-namespace XFILE
-{
- namespace MUSICDATABASEDIRECTORY
- {
- class CDirectoryNodeGenre : public CDirectoryNode
- {
- public:
- CDirectoryNodeGenre(const CStdString& strName, CDirectoryNode* pParent);
- protected:
- virtual NODE_TYPE GetChildType() const;
- virtual bool GetContent(CFileItemList& items) const;
- virtual CStdString GetLocalizedName() const;
- };
- }
-}
-
-
--- /dev/null
+/*
+ * Copyright (C) 2005-2013 Team XBMC
+ * http://www.xbmc.org
+ *
+ * This Program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This Program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with XBMC; see the file COPYING. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "DirectoryNodeGrouped.h"
+#include "QueryParams.h"
+#include "music/MusicDatabase.h"
+
+using namespace XFILE::MUSICDATABASEDIRECTORY;
+
+CDirectoryNodeGrouped::CDirectoryNodeGrouped(NODE_TYPE type, const CStdString& strName, CDirectoryNode* pParent)
+ : CDirectoryNode(type, strName, pParent)
+{ }
+
+NODE_TYPE CDirectoryNodeGrouped::GetChildType() const
+{
+ if (GetType() == NODE_TYPE_YEAR)
+ return NODE_TYPE_YEAR_ALBUM;
+
+ return NODE_TYPE_ARTIST;
+}
+
+CStdString CDirectoryNodeGrouped::GetLocalizedName() const
+{
+ CMusicDatabase db;
+ if (db.Open())
+ return db.GetItemById(GetContentType(), GetID());
+ return "";
+}
+
+bool CDirectoryNodeGrouped::GetContent(CFileItemList& items) const
+{
+ CMusicDatabase musicdatabase;
+ if (!musicdatabase.Open())
+ return false;
+
+ return musicdatabase.GetItems(BuildPath(), GetContentType(), items);
+}
+
+std::string CDirectoryNodeGrouped::GetContentType() const
+{
+ switch (GetType())
+ {
+ case NODE_TYPE_GENRE:
+ return "genres";
+ case NODE_TYPE_YEAR:
+ return "years";
+ default:
+ break;
+ }
+
+ return "";
+}
--- /dev/null
+#pragma once
+/*
+ * Copyright (C) 2005-2013 Team XBMC
+ * http://www.xbmc.org
+ *
+ * This Program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This Program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with XBMC; see the file COPYING. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "DirectoryNode.h"
+
+namespace XFILE
+{
+ namespace MUSICDATABASEDIRECTORY
+ {
+ class CDirectoryNodeGrouped : public CDirectoryNode
+ {
+ public:
+ CDirectoryNodeGrouped(NODE_TYPE type, const CStdString& strName, CDirectoryNode* pParent);
+ protected:
+ virtual NODE_TYPE GetChildType() const;
+ virtual bool GetContent(CFileItemList& items) const;
+ virtual CStdString GetLocalizedName() const;
+
+ private:
+ std::string GetContentType() const;
+ };
+ }
+}
+
+
namespace MUSICDATABASEDIRECTORY
{
Node OverviewChildren[] = {
- { NODE_TYPE_GENRE, 1, 135 },
- { NODE_TYPE_ARTIST, 2, 133 },
- { NODE_TYPE_ALBUM, 3, 132 },
- { NODE_TYPE_SINGLES, 10, 1050 },
- { NODE_TYPE_SONG, 4, 134 },
- { NODE_TYPE_YEAR, 9, 652 },
- { NODE_TYPE_TOP100, 5, 271 },
- { NODE_TYPE_ALBUM_RECENTLY_ADDED, 6, 359 },
- { NODE_TYPE_ALBUM_RECENTLY_PLAYED, 7, 517 },
- { NODE_TYPE_ALBUM_COMPILATIONS, 8, 521 },
+ { NODE_TYPE_GENRE, "genres", 135 },
+ { NODE_TYPE_ARTIST, "artists", 133 },
+ { NODE_TYPE_ALBUM, "albums", 132 },
+ { NODE_TYPE_SINGLES, "singles", 1050 },
+ { NODE_TYPE_SONG, "songs", 134 },
+ { NODE_TYPE_YEAR, "years", 652 },
+ { NODE_TYPE_TOP100, "top100", 271 },
+ { NODE_TYPE_ALBUM_RECENTLY_ADDED, "recentlyaddedalbums", 359 },
+ { NODE_TYPE_ALBUM_RECENTLY_PLAYED, "recentlyplayedalbums", 517 },
+ { NODE_TYPE_ALBUM_COMPILATIONS, "compilations", 521 },
};
};
};
NODE_TYPE CDirectoryNodeOverview::GetChildType() const
{
for (unsigned int i = 0; i < sizeof(OverviewChildren) / sizeof(Node); ++i)
- if (GetID() == OverviewChildren[i].id)
+ if (GetName().Equals(OverviewChildren[i].id.c_str()))
return OverviewChildren[i].node;
return NODE_TYPE_NONE;
}
CStdString CDirectoryNodeOverview::GetLocalizedName() const
{
for (unsigned int i = 0; i < sizeof(OverviewChildren) / sizeof(Node); ++i)
- if (GetID() == OverviewChildren[i].id)
+ if (GetName().Equals(OverviewChildren[i].id.c_str()))
return g_localizeStrings.Get(OverviewChildren[i].label);
return "";
}
CFileItemPtr pItem(new CFileItem(g_localizeStrings.Get(OverviewChildren[i].label)));
CStdString strDir;
- strDir.Format("%ld/", OverviewChildren[i].id);
+ strDir.Format("%s/", OverviewChildren[i].id);
pItem->SetPath(BuildPath() + strDir);
pItem->m_bIsFolder = true;
pItem->SetCanQueue(false);
using namespace XFILE::MUSICDATABASEDIRECTORY;
Node Top100Children[] = {
- { NODE_TYPE_SONG_TOP100, 1, 10504 },
- { NODE_TYPE_ALBUM_TOP100, 2, 10505 },
+ { NODE_TYPE_SONG_TOP100, "songs", 10504 },
+ { NODE_TYPE_ALBUM_TOP100, "albums", 10505 },
};
CDirectoryNodeTop100::CDirectoryNodeTop100(const CStdString& strName, CDirectoryNode* pParent)
NODE_TYPE CDirectoryNodeTop100::GetChildType() const
{
for (unsigned int i = 0; i < sizeof(Top100Children) / sizeof(Node); ++i)
- if (GetID() == Top100Children[i].id)
+ if (GetName().Equals(Top100Children[i].id.c_str()))
return Top100Children[i].node;
return NODE_TYPE_NONE;
CStdString CDirectoryNodeTop100::GetLocalizedName() const
{
for (unsigned int i = 0; i < sizeof(Top100Children) / sizeof(Node); ++i)
- if (GetID() == Top100Children[i].id)
+ if (GetName().Equals(Top100Children[i].id.c_str()))
return g_localizeStrings.Get(Top100Children[i].label);
return "";
}
{
CFileItemPtr pItem(new CFileItem(g_localizeStrings.Get(Top100Children[i].label)));
CStdString strDir;
- strDir.Format("%ld/", Top100Children[i].id);
+ strDir.Format("%s/", Top100Children[i].id);
pItem->SetPath(BuildPath() + strDir);
pItem->m_bIsFolder = true;
items.Add(pItem);
+++ /dev/null
-/*
- * Copyright (C) 2005-2013 Team XBMC
- * http://www.xbmc.org
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- */
-
-#include "DirectoryNodeYear.h"
-#include "QueryParams.h"
-#include "music/MusicDatabase.h"
-
-using namespace XFILE::MUSICDATABASEDIRECTORY;
-
-CDirectoryNodeYear::CDirectoryNodeYear(const CStdString& strName, CDirectoryNode* pParent)
- : CDirectoryNode(NODE_TYPE_YEAR, strName, pParent)
-{
-
-}
-
-NODE_TYPE CDirectoryNodeYear::GetChildType() const
-{
- return NODE_TYPE_YEAR_ALBUM;
-}
-
-CStdString CDirectoryNodeYear::GetLocalizedName() const
-{
- return GetName();
-}
-
-bool CDirectoryNodeYear::GetContent(CFileItemList& items) const
-{
- CMusicDatabase musicdatabase;
- if (!musicdatabase.Open())
- return false;
-
- CQueryParams params;
- CollectQueryParams(params);
-
- bool bSuccess=musicdatabase.GetYearsNav(BuildPath(), items);
-
- musicdatabase.Close();
-
- return bSuccess;
-}
+++ /dev/null
-#pragma once
-/*
- * Copyright (C) 2005-2013 Team XBMC
- * http://www.xbmc.org
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- */
-
-#include "DirectoryNode.h"
-
-namespace XFILE
-{
- namespace MUSICDATABASEDIRECTORY
- {
- class CDirectoryNodeYear : public CDirectoryNode
- {
- public:
- CDirectoryNodeYear(const CStdString& strName, CDirectoryNode* pParent);
- protected:
- virtual NODE_TYPE GetChildType() const;
- virtual bool GetContent(CFileItemList& items) const;
- virtual CStdString GetLocalizedName() const;
- };
- }
-}
-
-
DirectoryNodeAlbumTop100.cpp \
DirectoryNodeAlbumTop100Song.cpp \
DirectoryNodeArtist.cpp \
- DirectoryNodeGenre.cpp \
+ DirectoryNodeGrouped.cpp \
DirectoryNodeOverview.cpp \
DirectoryNodeRoot.cpp \
DirectoryNodeSingles.cpp \
DirectoryNodeSong.cpp \
DirectoryNodeSongTop100.cpp \
DirectoryNodeTop100.cpp \
- DirectoryNodeYear.cpp \
DirectoryNodeYearAlbum.cpp \
DirectoryNodeYearSong.cpp \
QueryParams.cpp \
#include "playlists/SmartPlayList.h"
#include "settings/GUISettings.h"
#include "utils/log.h"
+#include "utils/StringUtils.h"
#include "utils/URIUtils.h"
#include "video/VideoDatabase.h"
#define PROPERTY_PATH_DB "path.db"
#define PROPERTY_SORT_ORDER "sort.order"
#define PROPERTY_SORT_ASCENDING "sort.ascending"
+#define PROPERTY_GROUP_BY "group.by"
+#define PROPERTY_GROUP_MIXED "group.mixed"
namespace XFILE
{
sorting.sortAttributes = SortAttributeIgnoreArticle;
std::string option = !filter ? "xsp" : "filter";
+ const CStdString& group = playlist.GetGroup();
+ bool isGrouped = !group.empty() && !StringUtils::EqualsNoCase(group, "none") && !playlist.IsGroupMixed();
if (playlist.GetType().Equals("movies") ||
playlist.GetType().Equals("tvshows") ||
{
switch (mediaType)
{
- case MediaTypeTvShow:
- case MediaTypeEpisode:
- baseDir = "videodb://2/2/";
- break;
+ case MediaTypeTvShow:
+ baseDir = "videodb://tvshows/";
+ break;
- case MediaTypeMovie:
- baseDir = "videodb://1/2/";
- break;
+ case MediaTypeEpisode:
+ baseDir = "videodb://tvshows/";
+ break;
- default:
- return false;
+ case MediaTypeMovie:
+ baseDir = "videodb://movies/";
+ break;
+
+ default:
+ return false;
}
+
+ if (!isGrouped)
+ baseDir += "titles";
+ else
+ baseDir += group;
+ URIUtils::AddSlashAtEnd(baseDir);
}
CVideoDbUrl videoUrl;
videoUrl.RemoveOption(option);
CDatabase::Filter dbfilter;
- success = db.GetSortedVideos(mediaType, videoUrl.ToString(), sorting, items, dbfilter);
+ success = db.GetItems(videoUrl.ToString(), items, dbfilter, sorting);
db.Close();
// if we retrieve a list of episodes and we didn't receive
// a pre-defined base path, we need to fix it
- if (strBaseDir.empty() && mediaType == MediaTypeEpisode)
+ if (strBaseDir.empty() && mediaType == MediaTypeEpisode && !isGrouped)
videoUrl.AppendPath("-1/-1/");
items.SetProperty(PROPERTY_PATH_DB, videoUrl.ToString());
}
}
- else if (playlist.GetType().Equals("albums"))
+ else if (playlist.GetType().Equals("artists") ||
+ playlist.GetType().Equals("albums") ||
+ playlist.GetType().Equals("songs") || playlist.GetType().Equals("mixed") || playlist.GetType().IsEmpty())
{
CMusicDatabase db;
if (db.Open())
{
- CMusicDbUrl musicUrl;
- if (!musicUrl.FromString(!strBaseDir.empty() ? strBaseDir : "musicdb://3/"))
- return false;
+ CSmartPlaylist plist(playlist);
+ if (playlist.GetType().Equals("mixed") || playlist.GetType().IsEmpty())
+ plist.SetType("songs");
- // store the smartplaylist as JSON in the URL as well
- CStdString xsp;
- if (!playlist.IsEmpty(filter))
- {
- if (!playlist.SaveAsJson(xsp, !filter))
- return false;
- }
+ MediaType mediaType = DatabaseUtils::MediaTypeFromString(plist.GetType());
- if (!xsp.empty())
- musicUrl.AddOption(option, xsp);
- else
- musicUrl.RemoveOption(option);
-
- CDatabase::Filter dbfilter;
- success = db.GetAlbumsByWhere(musicUrl.ToString(), dbfilter, items, sorting);
- db.Close();
- items.SetContent("albums");
- items.SetProperty(PROPERTY_PATH_DB, musicUrl.ToString());
- }
- }
- else if (playlist.GetType().Equals("artists"))
- {
- CMusicDatabase db;
- if (db.Open())
- {
- CMusicDbUrl musicUrl;
- if (!musicUrl.FromString("musicdb://2/"))
- return false;
-
- // store the smartplaylist as JSON in the URL as well
- CStdString xsp;
- if (!playlist.IsEmpty(filter))
+ CStdString baseDir = strBaseDir;
+ if (strBaseDir.empty())
{
- if (!playlist.SaveAsJson(xsp, !filter))
- return false;
- }
-
- if (!xsp.empty())
- musicUrl.AddOption(option, xsp);
- else
- musicUrl.RemoveOption(option);
+ baseDir = "musicdb://";
+ if (!isGrouped)
+ {
+ switch (mediaType)
+ {
+ case MediaTypeArtist:
+ baseDir += "artists";
+ break;
+
+ case MediaTypeAlbum:
+ baseDir += "albums";
+ break;
+
+ case MediaTypeSong:
+ baseDir += "songs";
+ break;
+
+ default:
+ return false;
+ }
+ }
+ else
+ baseDir += group;
- CDatabase::Filter dbfilter;
- success = db.GetArtistsNav(musicUrl.ToString(), items, !g_guiSettings.GetBool("musiclibrary.showcompilationartists"), -1, -1, -1, dbfilter, sorting);
- db.Close();
- items.SetContent("artists");
- items.SetProperty(PROPERTY_PATH_DB, musicUrl.ToString());
- }
- }
+ URIUtils::AddSlashAtEnd(baseDir);
+ }
- if (playlist.GetType().Equals("songs") || playlist.GetType().Equals("mixed") || playlist.GetType().IsEmpty())
- {
- CMusicDatabase db;
- if (db.Open())
- {
- CSmartPlaylist songPlaylist(playlist);
- if (playlist.GetType().IsEmpty() || playlist.GetType().Equals("mixed"))
- songPlaylist.SetType("songs");
-
CMusicDbUrl musicUrl;
- if (!musicUrl.FromString(!strBaseDir.empty() ? strBaseDir : "musicdb://4/"))
+ if (!musicUrl.FromString(baseDir))
return false;
// store the smartplaylist as JSON in the URL as well
CStdString xsp;
- if (!songPlaylist.IsEmpty(filter))
+ if (!plist.IsEmpty(filter))
{
- if (!songPlaylist.SaveAsJson(xsp, !filter))
+ if (!plist.SaveAsJson(xsp, !filter))
return false;
}
musicUrl.RemoveOption(option);
CDatabase::Filter dbfilter;
- success = db.GetSongsByWhere(musicUrl.ToString(), dbfilter, items, sorting);
+ success = db.GetItems(musicUrl.ToString(), items, dbfilter, sorting);
db.Close();
- items.SetContent("songs");
+
items.SetProperty(PROPERTY_PATH_DB, musicUrl.ToString());
}
}
+
if (playlist.GetType().Equals("musicvideos") || playlist.GetType().Equals("mixed"))
{
CVideoDatabase db;
if (playlist.GetType().Equals("mixed"))
mvidPlaylist.SetType("musicvideos");
+ CStdString baseDir = strBaseDir;
+ if (baseDir.empty())
+ {
+ baseDir = "videodb://musicvideos/";
+
+ if (!isGrouped)
+ baseDir += "titles";
+ else
+ baseDir += group;
+ URIUtils::AddSlashAtEnd(baseDir);
+ }
+
CVideoDbUrl videoUrl;
- if (!videoUrl.FromString(!strBaseDir.empty() ? strBaseDir : "videodb://3/2/"))
+ if (!videoUrl.FromString(baseDir))
return false;
// store the smartplaylist as JSON in the URL as well
videoUrl.RemoveOption(option);
CFileItemList items2;
- success2 = db.GetSortedVideos(MediaTypeMusicVideo, videoUrl.ToString(), sorting, items2);
+ CDatabase::Filter dbfilter;
+ success2 = db.GetItems(videoUrl.ToString(), items2, dbfilter, sorting);
+
db.Close();
+ if (items.Size() <= 0)
+ items.SetPath(videoUrl.ToString());
items.Append(items2);
if (items2.Size())
items.SetProperty(PROPERTY_PATH_DB, videoUrl.ToString());
}
}
+
items.SetLabel(playlist.GetName());
+ if (isGrouped)
+ items.SetContent(group);
+ else
+ items.SetContent(playlist.GetType());
+
items.SetProperty(PROPERTY_SORT_ORDER, (int)playlist.GetOrder());
items.SetProperty(PROPERTY_SORT_ASCENDING, playlist.GetOrderDirection() == SortOrderAscending);
+ if (!group.empty())
+ {
+ items.SetProperty(PROPERTY_GROUP_BY, group);
+ items.SetProperty(PROPERTY_GROUP_MIXED, playlist.IsGroupMixed());
+ }
+
+ // sort grouped list by label
+ if (items.Size() > 1 && !group.empty())
+ items.Sort(SORT_METHOD_LABEL_IGNORE_THE, SortOrderAscending);
// go through and set the playlist order
for (int i = 0; i < items.Size(); i++)
switch (GetDirectoryChildType(strDirectory))
{
case NODE_TYPE_TITLE_MOVIES:
- if (strDirectory.Equals("videodb://1/2/"))
+ if (strDirectory.Equals("videodb://movies/titles/"))
{
if (g_guiSettings.GetBool("myvideos.flatten"))
return "DefaultMovies.png";
}
return "";
case NODE_TYPE_TITLE_TVSHOWS:
- if (strDirectory.Equals("videodb://2/2/"))
+ if (strDirectory.Equals("videodb://tvshows/titles/"))
{
if (g_guiSettings.GetBool("myvideos.flatten"))
return "DefaultTVShows.png";
}
return "";
case NODE_TYPE_TITLE_MUSICVIDEOS:
- if (strDirectory.Equals("videodb://3/2/"))
+ if (strDirectory.Equals("videodb://musicvideos/titles/"))
{
if (g_guiSettings.GetBool("myvideos.flatten"))
return "DefaultMusicVideos.png";
#include "QueryParams.h"
#include "DirectoryNodeRoot.h"
#include "DirectoryNodeOverview.h"
-#include "DirectoryNodeGenre.h"
-#include "DirectoryNodeCountry.h"
-#include "DirectoryNodeSets.h"
+#include "DirectoryNodeGrouped.h"
#include "DirectoryNodeTitleMovies.h"
#include "DirectoryNodeTitleTvShows.h"
-#include "DirectoryNodeYear.h"
-#include "DirectoryNodeActor.h"
-#include "DirectoryNodeDirector.h"
#include "DirectoryNodeMoviesOverview.h"
#include "DirectoryNodeTvShowsOverview.h"
#include "DirectoryNodeSeasons.h"
#include "DirectoryNodeEpisodes.h"
#include "DirectoryNodeRecentlyAddedMovies.h"
#include "DirectoryNodeRecentlyAddedEpisodes.h"
-#include "DirectoryNodeStudio.h"
#include "DirectoryNodeMusicVideosOverview.h"
#include "DirectoryNodeRecentlyAddedMusicVideos.h"
#include "DirectoryNodeTitleMusicVideos.h"
-#include "DirectoryNodeMusicVideoAlbum.h"
-#include "DirectoryNodeTags.h"
#include "video/VideoInfoTag.h"
#include "URL.h"
#include "settings/AdvancedSettings.h"
case NODE_TYPE_OVERVIEW:
return new CDirectoryNodeOverview(strName, pParent);
case NODE_TYPE_GENRE:
- return new CDirectoryNodeGenre(strName, pParent);
case NODE_TYPE_COUNTRY:
- return new CDirectoryNodeCountry(strName, pParent);
case NODE_TYPE_SETS:
- return new CDirectoryNodeSets(strName, pParent);
case NODE_TYPE_TAGS:
- return new CDirectoryNodeTags(strName, pParent);
case NODE_TYPE_YEAR:
- return new CDirectoryNodeYear(strName, pParent);
case NODE_TYPE_ACTOR:
- return new CDirectoryNodeActor(strName, pParent);
case NODE_TYPE_DIRECTOR:
- return new CDirectoryNodeDirector(strName, pParent);
+ case NODE_TYPE_STUDIO:
+ case NODE_TYPE_MUSICVIDEOS_ALBUM:
+ return new CDirectoryNodeGrouped(Type, strName, pParent);
case NODE_TYPE_TITLE_MOVIES:
return new CDirectoryNodeTitleMovies(strName, pParent);
case NODE_TYPE_TITLE_TVSHOWS:
return new CDirectoryNodeRecentlyAddedMovies(strName,pParent);
case NODE_TYPE_RECENTLY_ADDED_EPISODES:
return new CDirectoryNodeRecentlyAddedEpisodes(strName,pParent);
- case NODE_TYPE_STUDIO:
- return new CDirectoryNodeStudio(strName,pParent);
case NODE_TYPE_MUSICVIDEOS_OVERVIEW:
return new CDirectoryNodeMusicVideosOverview(strName,pParent);
case NODE_TYPE_RECENTLY_ADDED_MUSICVIDEOS:
return new CDirectoryNodeRecentlyAddedMusicVideos(strName,pParent);
case NODE_TYPE_TITLE_MUSICVIDEOS:
return new CDirectoryNodeTitleMusicVideos(strName,pParent);
- case NODE_TYPE_MUSICVIDEOS_ALBUM:
- return new CDirectoryNodeMusicVideoAlbum(strName,pParent);
default:
break;
}
} NODE_TYPE;
typedef struct {
- NODE_TYPE node;
- int id;
- int label;
+ NODE_TYPE node;
+ std::string id;
+ int label;
} Node;
class CDirectoryNode
+++ /dev/null
-/*
- * Copyright (C) 2005-2013 Team XBMC
- * http://www.xbmc.org
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- */
-
-#include "DirectoryNodeActor.h"
-#include "QueryParams.h"
-#include "video/VideoDatabase.h"
-
-using namespace XFILE::VIDEODATABASEDIRECTORY;
-
-CDirectoryNodeActor::CDirectoryNodeActor(const CStdString& strName, CDirectoryNode* pParent)
- : CDirectoryNode(NODE_TYPE_ACTOR, strName, pParent)
-{
-
-}
-
-NODE_TYPE CDirectoryNodeActor::GetChildType() const
-{
- CQueryParams params;
- CollectQueryParams(params);
- if (params.GetContentType() == VIDEODB_CONTENT_MOVIES)
- return NODE_TYPE_TITLE_MOVIES;
- if (params.GetContentType() == VIDEODB_CONTENT_MUSICVIDEOS)
- return NODE_TYPE_MUSICVIDEOS_ALBUM;
-
- return NODE_TYPE_TITLE_TVSHOWS;
-}
-
-CStdString CDirectoryNodeActor::GetLocalizedName() const
-{
- CVideoDatabase db;
- if (db.Open())
- return db.GetPersonById(GetID());
- return "";
-}
-
-bool CDirectoryNodeActor::GetContent(CFileItemList& items) const
-{
- CVideoDatabase videodatabase;
- if (!videodatabase.Open())
- return false;
-
- CQueryParams params;
- CollectQueryParams(params);
-
- bool bSuccess=videodatabase.GetActorsNav(BuildPath(), items, params.GetContentType());
-
- videodatabase.Close();
-
- return bSuccess;
-}
-
+++ /dev/null
-#pragma once
-/*
- * Copyright (C) 2005-2013 Team XBMC
- * http://www.xbmc.org
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- */
-
-#include "DirectoryNode.h"
-
-namespace XFILE
-{
- namespace VIDEODATABASEDIRECTORY
- {
- class CDirectoryNodeActor : public CDirectoryNode
- {
- public:
- CDirectoryNodeActor(const CStdString& strName, CDirectoryNode* pParent);
- protected:
- virtual NODE_TYPE GetChildType() const;
- virtual bool GetContent(CFileItemList& items) const;
- virtual CStdString GetLocalizedName() const;
- };
- }
-}
-
-
+++ /dev/null
-/*
- * Copyright (C) 2005-2013 Team XBMC
- * http://www.xbmc.org
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- */
-
-#include "DirectoryNodeCountry.h"
-#include "QueryParams.h"
-#include "video/VideoDatabase.h"
-
-using namespace XFILE::VIDEODATABASEDIRECTORY;
-
-CDirectoryNodeCountry::CDirectoryNodeCountry(const CStdString& strName, CDirectoryNode* pParent)
- : CDirectoryNode(NODE_TYPE_COUNTRY, strName, pParent)
-{
-
-}
-
-NODE_TYPE CDirectoryNodeCountry::GetChildType() const
-{
- return NODE_TYPE_TITLE_MOVIES;
-}
-
-CStdString CDirectoryNodeCountry::GetLocalizedName() const
-{
- CVideoDatabase db;
- if (db.Open())
- return db.GetCountryById(GetID());
- return "";
-}
-
-bool CDirectoryNodeCountry::GetContent(CFileItemList& items) const
-{
- CVideoDatabase videodatabase;
- if (!videodatabase.Open())
- return false;
-
- CQueryParams params;
- CollectQueryParams(params);
-
- bool bSuccess=videodatabase.GetCountriesNav(BuildPath(), items, params.GetContentType());
-
- videodatabase.Close();
-
- return bSuccess;
-}
+++ /dev/null
-#pragma once
-/*
- * Copyright (C) 2005-2013 Team XBMC
- * http://www.xbmc.org
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- */
-
-#include "DirectoryNode.h"
-
-namespace XFILE
-{
- namespace VIDEODATABASEDIRECTORY
- {
- class CDirectoryNodeCountry : public CDirectoryNode
- {
- public:
- CDirectoryNodeCountry(const CStdString& strName, CDirectoryNode* pParent);
- protected:
- virtual NODE_TYPE GetChildType() const;
- virtual bool GetContent(CFileItemList& items) const;
- virtual CStdString GetLocalizedName() const;
- };
- }
-}
-
-
+++ /dev/null
-/*
- * Copyright (C) 2005-2013 Team XBMC
- * http://www.xbmc.org
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- */
-
-#include "DirectoryNodeDirector.h"
-#include "QueryParams.h"
-#include "video/VideoDatabase.h"
-
-using namespace XFILE::VIDEODATABASEDIRECTORY;
-
-CDirectoryNodeDirector::CDirectoryNodeDirector(const CStdString& strName, CDirectoryNode* pParent)
- : CDirectoryNode(NODE_TYPE_DIRECTOR, strName, pParent)
-{
-
-}
-
-NODE_TYPE CDirectoryNodeDirector::GetChildType() const
-{
- CQueryParams params;
- CollectQueryParams(params);
- if (params.GetContentType() == VIDEODB_CONTENT_MOVIES)
- return NODE_TYPE_TITLE_MOVIES;
- if (params.GetContentType() == VIDEODB_CONTENT_MUSICVIDEOS)
- return NODE_TYPE_TITLE_MUSICVIDEOS;
-
- return NODE_TYPE_TITLE_TVSHOWS;
-}
-
-CStdString CDirectoryNodeDirector::GetLocalizedName() const
-{
- CVideoDatabase db;
- if (db.Open())
- return db.GetPersonById(GetID());
- return "";
-}
-
-bool CDirectoryNodeDirector::GetContent(CFileItemList& items) const
-{
- CVideoDatabase videodatabase;
- if (!videodatabase.Open())
- return false;
-
- CQueryParams params;
- CollectQueryParams(params);
-
- bool bSuccess=videodatabase.GetDirectorsNav(BuildPath(), items, params.GetContentType());
-
- videodatabase.Close();
-
- return bSuccess;
-}
-
+++ /dev/null
-#pragma once
-/*
- * Copyright (C) 2005-2013 Team XBMC
- * http://www.xbmc.org
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- */
-
-#include "DirectoryNode.h"
-
-namespace XFILE
-{
- namespace VIDEODATABASEDIRECTORY
- {
- class CDirectoryNodeDirector : public CDirectoryNode
- {
- public:
- CDirectoryNodeDirector(const CStdString& strName, CDirectoryNode* pParent);
- protected:
- virtual NODE_TYPE GetChildType() const;
- virtual bool GetContent(CFileItemList& items) const;
- virtual CStdString GetLocalizedName() const;
- };
- }
-}
-
-
+++ /dev/null
-/*
- * Copyright (C) 2005-2013 Team XBMC
- * http://www.xbmc.org
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- */
-
-#include "DirectoryNodeGenre.h"
-#include "QueryParams.h"
-#include "video/VideoDatabase.h"
-
-using namespace XFILE::VIDEODATABASEDIRECTORY;
-
-CDirectoryNodeGenre::CDirectoryNodeGenre(const CStdString& strName, CDirectoryNode* pParent)
- : CDirectoryNode(NODE_TYPE_GENRE, strName, pParent)
-{
-
-}
-
-NODE_TYPE CDirectoryNodeGenre::GetChildType() const
-{
- CQueryParams params;
- CollectQueryParams(params);
- if (params.GetContentType() == VIDEODB_CONTENT_MOVIES)
- return NODE_TYPE_TITLE_MOVIES;
- if (params.GetContentType() == VIDEODB_CONTENT_MUSICVIDEOS)
- return NODE_TYPE_TITLE_MUSICVIDEOS;
-
- return NODE_TYPE_TITLE_TVSHOWS;
-}
-
-CStdString CDirectoryNodeGenre::GetLocalizedName() const
-{
- CVideoDatabase db;
- if (db.Open())
- return db.GetGenreById(GetID());
- return "";
-}
-
-bool CDirectoryNodeGenre::GetContent(CFileItemList& items) const
-{
- CVideoDatabase videodatabase;
- if (!videodatabase.Open())
- return false;
-
- CQueryParams params;
- CollectQueryParams(params);
-
- bool bSuccess=videodatabase.GetGenresNav(BuildPath(), items, params.GetContentType());
-
- videodatabase.Close();
-
- return bSuccess;
-}
+++ /dev/null
-#pragma once
-/*
- * Copyright (C) 2005-2013 Team XBMC
- * http://www.xbmc.org
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- */
-
-#include "DirectoryNode.h"
-
-namespace XFILE
-{
- namespace VIDEODATABASEDIRECTORY
- {
- class CDirectoryNodeGenre : public CDirectoryNode
- {
- public:
- CDirectoryNodeGenre(const CStdString& strName, CDirectoryNode* pParent);
- protected:
- virtual NODE_TYPE GetChildType() const;
- virtual bool GetContent(CFileItemList& items) const;
- virtual CStdString GetLocalizedName() const;
- };
- }
-}
-
-
--- /dev/null
+/*
+ * Copyright (C) 2005-2012 Team XBMC
+ * http://www.xbmc.org
+ *
+ * This Program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This Program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with XBMC; see the file COPYING. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "DirectoryNodeGrouped.h"
+#include "QueryParams.h"
+#include "video/VideoDatabase.h"
+
+using namespace XFILE::VIDEODATABASEDIRECTORY;
+
+CDirectoryNodeGrouped::CDirectoryNodeGrouped(NODE_TYPE type, const CStdString& strName, CDirectoryNode* pParent)
+ : CDirectoryNode(type, strName, pParent)
+{ }
+
+NODE_TYPE CDirectoryNodeGrouped::GetChildType() const
+{
+ CQueryParams params;
+ CollectQueryParams(params);
+
+ if (params.GetContentType() == VIDEODB_CONTENT_MOVIES)
+ return NODE_TYPE_TITLE_MOVIES;
+ if (params.GetContentType() == VIDEODB_CONTENT_MUSICVIDEOS)
+ {
+ if (GetType() == NODE_TYPE_ACTOR)
+ return NODE_TYPE_MUSICVIDEOS_ALBUM;
+ else
+ return NODE_TYPE_TITLE_MUSICVIDEOS;
+ }
+
+ return NODE_TYPE_TITLE_TVSHOWS;
+}
+
+CStdString CDirectoryNodeGrouped::GetLocalizedName() const
+{
+ CVideoDatabase db;
+ if (db.Open())
+ return db.GetItemById(GetContentType(), GetID());
+
+ return "";
+}
+
+bool CDirectoryNodeGrouped::GetContent(CFileItemList& items) const
+{
+ CVideoDatabase videodatabase;
+ if (!videodatabase.Open())
+ return false;
+
+ CQueryParams params;
+ CollectQueryParams(params);
+
+ std::string itemType = GetContentType(params);
+ if (itemType.empty())
+ return false;
+
+ return videodatabase.GetItems(BuildPath(), (VIDEODB_CONTENT_TYPE)params.GetContentType(), itemType, items);
+}
+
+std::string CDirectoryNodeGrouped::GetContentType() const
+{
+ CQueryParams params;
+ CollectQueryParams(params);
+
+ return GetContentType(params);
+}
+
+std::string CDirectoryNodeGrouped::GetContentType(const CQueryParams ¶ms) const
+{
+ switch (GetType())
+ {
+ case NODE_TYPE_GENRE:
+ return "genres";
+ case NODE_TYPE_COUNTRY:
+ return "countries";
+ case NODE_TYPE_SETS:
+ return "sets";
+ case NODE_TYPE_TAGS:
+ return "tags";
+ case NODE_TYPE_YEAR:
+ return "years";
+ case NODE_TYPE_ACTOR:
+ if ((VIDEODB_CONTENT_TYPE)params.GetContentType() == VIDEODB_CONTENT_MUSICVIDEOS)
+ return "artists";
+ else
+ return "actors";
+ case NODE_TYPE_DIRECTOR:
+ return "directors";
+ case NODE_TYPE_STUDIO:
+ return "studios";
+ case NODE_TYPE_MUSICVIDEOS_ALBUM:
+ return "albums";
+
+ case NODE_TYPE_EPISODES:
+ case NODE_TYPE_MOVIES_OVERVIEW:
+ case NODE_TYPE_MUSICVIDEOS_OVERVIEW:
+ case NODE_TYPE_NONE:
+ case NODE_TYPE_OVERVIEW:
+ case NODE_TYPE_RECENTLY_ADDED_EPISODES:
+ case NODE_TYPE_RECENTLY_ADDED_MOVIES:
+ case NODE_TYPE_RECENTLY_ADDED_MUSICVIDEOS:
+ case NODE_TYPE_ROOT:
+ case NODE_TYPE_SEASONS:
+ case NODE_TYPE_TITLE_MOVIES:
+ case NODE_TYPE_TITLE_MUSICVIDEOS:
+ case NODE_TYPE_TITLE_TVSHOWS:
+ case NODE_TYPE_TVSHOWS_OVERVIEW:
+ default:
+ break;
+ }
+
+ return "";
+}
--- /dev/null
+#pragma once
+/*
+ * Copyright (C) 2005-2013 Team XBMC
+ * http://www.xbmc.org
+ *
+ * This Program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This Program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with XBMC; see the file COPYING. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "DirectoryNode.h"
+
+namespace XFILE
+{
+ namespace VIDEODATABASEDIRECTORY
+ {
+ class CDirectoryNodeGrouped : public CDirectoryNode
+ {
+ public:
+ CDirectoryNodeGrouped(NODE_TYPE type, const CStdString& strName, CDirectoryNode* pParent);
+ protected:
+ virtual NODE_TYPE GetChildType() const;
+ virtual bool GetContent(CFileItemList& items) const;
+ virtual CStdString GetLocalizedName() const;
+
+ private:
+ std::string GetContentType() const;
+ std::string GetContentType(const CQueryParams ¶ms) const;
+ };
+ }
+}
+
+
using namespace std;
Node MovieChildren[] = {
- { NODE_TYPE_GENRE, 1, 135 },
- { NODE_TYPE_TITLE_MOVIES, 2, 369 },
- { NODE_TYPE_YEAR, 3, 562 },
- { NODE_TYPE_ACTOR, 4, 344 },
- { NODE_TYPE_DIRECTOR, 5, 20348 },
- { NODE_TYPE_STUDIO, 6, 20388 },
- { NODE_TYPE_SETS, 7, 20434 },
- { NODE_TYPE_COUNTRY, 8, 20451 },
- { NODE_TYPE_TAGS, 9, 20459 }
+ { NODE_TYPE_GENRE, "genres", 135 },
+ { NODE_TYPE_TITLE_MOVIES, "titles", 369 },
+ { NODE_TYPE_YEAR, "years", 562 },
+ { NODE_TYPE_ACTOR, "actors", 344 },
+ { NODE_TYPE_DIRECTOR, "directors", 20348 },
+ { NODE_TYPE_STUDIO, "studios", 20388 },
+ { NODE_TYPE_SETS, "sets", 20434 },
+ { NODE_TYPE_COUNTRY, "countries", 20451 },
+ { NODE_TYPE_TAGS, "tags", 20459 }
};
CDirectoryNodeMoviesOverview::CDirectoryNodeMoviesOverview(const CStdString& strName, CDirectoryNode* pParent)
NODE_TYPE CDirectoryNodeMoviesOverview::GetChildType() const
{
for (unsigned int i = 0; i < sizeof(MovieChildren) / sizeof(Node); ++i)
- if (GetID() == MovieChildren[i].id)
+ if (GetName().Equals(MovieChildren[i].id.c_str()))
return MovieChildren[i].node;
return NODE_TYPE_NONE;
CStdString CDirectoryNodeMoviesOverview::GetLocalizedName() const
{
for (unsigned int i = 0; i < sizeof(MovieChildren) / sizeof(Node); ++i)
- if (GetID() == MovieChildren[i].id)
+ if (GetName().Equals(MovieChildren[i].id.c_str()))
return g_localizeStrings.Get(MovieChildren[i].label);
return "";
}
}
CVideoDbUrl itemUrl = videoUrl;
- CStdString strDir; strDir.Format("%ld/", MovieChildren[i].id);
+ CStdString strDir; strDir.Format("%s/", MovieChildren[i].id);
itemUrl.AppendPath(strDir);
CFileItemPtr pItem(new CFileItem(itemUrl.ToString(), true));
+++ /dev/null
-/*
- * Copyright (C) 2005-2013 Team XBMC
- * http://www.xbmc.org
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- */
-
-#include "DirectoryNodeMusicVideoAlbum.h"
-#include "QueryParams.h"
-#include "video/VideoDatabase.h"
-
-using namespace XFILE::VIDEODATABASEDIRECTORY;
-
-CDirectoryNodeMusicVideoAlbum::CDirectoryNodeMusicVideoAlbum(const CStdString& strName, CDirectoryNode* pParent)
- : CDirectoryNode(NODE_TYPE_MUSICVIDEOS_ALBUM, strName, pParent)
-{
-
-}
-
-NODE_TYPE CDirectoryNodeMusicVideoAlbum::GetChildType() const
-{
- return NODE_TYPE_TITLE_MUSICVIDEOS;
-}
-
-CStdString CDirectoryNodeMusicVideoAlbum::GetLocalizedName() const
-{
- CVideoDatabase db;
- if (db.Open())
- return db.GetMusicVideoAlbumById(GetID());
- return "";
-}
-
-bool CDirectoryNodeMusicVideoAlbum::GetContent(CFileItemList& items) const
-{
- CVideoDatabase videodatabase;
- if (!videodatabase.Open())
- return false;
-
- CQueryParams params;
- CollectQueryParams(params);
-
- bool bSuccess=videodatabase.GetMusicVideoAlbumsNav(BuildPath(), items, params.GetActorId());
-
- videodatabase.Close();
-
- return bSuccess;
-}
-
+++ /dev/null
-#pragma once
-/*
- * Copyright (C) 2005-2013 Team XBMC
- * http://www.xbmc.org
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- */
-
-#include "DirectoryNode.h"
-
-namespace XFILE
-{
- namespace VIDEODATABASEDIRECTORY
- {
- class CDirectoryNodeMusicVideoAlbum : public CDirectoryNode
- {
- public:
- CDirectoryNodeMusicVideoAlbum(const CStdString& strName, CDirectoryNode* pParent);
- protected:
- virtual NODE_TYPE GetChildType() const;
- virtual bool GetContent(CFileItemList& items) const;
- virtual CStdString GetLocalizedName() const;
- };
- }
-}
-
-
using namespace XFILE::VIDEODATABASEDIRECTORY;
Node MusicVideoChildren[] = {
- { NODE_TYPE_GENRE, 1, 135 },
- { NODE_TYPE_TITLE_MUSICVIDEOS, 2, 369 },
- { NODE_TYPE_YEAR, 3, 562 },
- { NODE_TYPE_ACTOR, 4, 133 },
- { NODE_TYPE_MUSICVIDEOS_ALBUM, 5, 132 },
- { NODE_TYPE_DIRECTOR, 6, 20348 },
- { NODE_TYPE_STUDIO, 7, 20388 },
- { NODE_TYPE_TAGS, 9, 20459 }
+ { NODE_TYPE_GENRE, "genres", 135 },
+ { NODE_TYPE_TITLE_MUSICVIDEOS, "titles", 369 },
+ { NODE_TYPE_YEAR, "years", 562 },
+ { NODE_TYPE_ACTOR, "artists", 133 },
+ { NODE_TYPE_MUSICVIDEOS_ALBUM, "albums", 132 },
+ { NODE_TYPE_DIRECTOR, "directors", 20348 },
+ { NODE_TYPE_STUDIO, "studios", 20388 },
+ { NODE_TYPE_TAGS, "tags", 20459 }
};
CDirectoryNodeMusicVideosOverview::CDirectoryNodeMusicVideosOverview(const CStdString& strName, CDirectoryNode* pParent)
NODE_TYPE CDirectoryNodeMusicVideosOverview::GetChildType() const
{
for (unsigned int i = 0; i < sizeof(MusicVideoChildren) / sizeof(Node); ++i)
- if (GetID() == MusicVideoChildren[i].id)
+ if (GetName().Equals(MusicVideoChildren[i].id.c_str()))
return MusicVideoChildren[i].node;
return NODE_TYPE_NONE;
CStdString CDirectoryNodeMusicVideosOverview::GetLocalizedName() const
{
for (unsigned int i = 0; i < sizeof(MusicVideoChildren) / sizeof(Node); ++i)
- if (GetID() == MusicVideoChildren[i].id)
+ if (GetName().Equals(MusicVideoChildren[i].id.c_str()))
return g_localizeStrings.Get(MusicVideoChildren[i].label);
return "";
}
CFileItemPtr pItem(new CFileItem(g_localizeStrings.Get(MusicVideoChildren[i].label)));
CVideoDbUrl itemUrl = videoUrl;
- CStdString strDir; strDir.Format("%ld/", MusicVideoChildren[i].id);
+ CStdString strDir; strDir.Format("%s/", MusicVideoChildren[i].id);
itemUrl.AppendPath(strDir);
pItem->SetPath(itemUrl.ToString());
Node OverviewChildren[] = {
- { NODE_TYPE_MOVIES_OVERVIEW, 1, 342 },
- { NODE_TYPE_TVSHOWS_OVERVIEW, 2, 20343 },
- { NODE_TYPE_MUSICVIDEOS_OVERVIEW, 3, 20389 },
- { NODE_TYPE_RECENTLY_ADDED_MOVIES, 4, 20386 },
- { NODE_TYPE_RECENTLY_ADDED_EPISODES, 5, 20387 },
- { NODE_TYPE_RECENTLY_ADDED_MUSICVIDEOS, 6, 20390 },
+ { NODE_TYPE_MOVIES_OVERVIEW, "movies", 342 },
+ { NODE_TYPE_TVSHOWS_OVERVIEW, "tvshows", 20343 },
+ { NODE_TYPE_MUSICVIDEOS_OVERVIEW, "musicvideos", 20389 },
+ { NODE_TYPE_RECENTLY_ADDED_MOVIES, "recentlyaddedmovies", 20386 },
+ { NODE_TYPE_RECENTLY_ADDED_EPISODES, "recentlyaddedepisodes", 20387 },
+ { NODE_TYPE_RECENTLY_ADDED_MUSICVIDEOS, "recentlyaddedmusicvideos", 20390 },
};
CDirectoryNodeOverview::CDirectoryNodeOverview(const CStdString& strName, CDirectoryNode* pParent)
NODE_TYPE CDirectoryNodeOverview::GetChildType() const
{
for (unsigned int i = 0; i < sizeof(OverviewChildren) / sizeof(Node); ++i)
- if (GetID() == OverviewChildren[i].id)
+ if (GetName().Equals(OverviewChildren[i].id.c_str()))
return OverviewChildren[i].node;
return NODE_TYPE_NONE;
CStdString CDirectoryNodeOverview::GetLocalizedName() const
{
for (unsigned int i = 0; i < sizeof(OverviewChildren) / sizeof(Node); ++i)
- if (GetID() == OverviewChildren[i].id)
+ if (GetName().Equals(OverviewChildren[i].id.c_str()))
return g_localizeStrings.Get(OverviewChildren[i].label);
return "";
}
if (hasMovies)
{
if (g_guiSettings.GetBool("myvideos.flatten"))
- vec.push_back(make_pair("1/2", 342));
+ vec.push_back(make_pair("movies/titles", 342));
else
- vec.push_back(make_pair("1", 342)); // Movies
+ vec.push_back(make_pair("movies", 342)); // Movies
}
if (hasTvShows)
{
if (g_guiSettings.GetBool("myvideos.flatten"))
- vec.push_back(make_pair("2/2", 20343));
+ vec.push_back(make_pair("tvshows/titles", 20343));
else
- vec.push_back(make_pair("2", 20343)); // TV Shows
+ vec.push_back(make_pair("tvshows", 20343)); // TV Shows
}
if (hasMusicVideos)
{
if (g_guiSettings.GetBool("myvideos.flatten"))
- vec.push_back(make_pair("3/2", 20389));
+ vec.push_back(make_pair("musicvideos/titles", 20389));
else
- vec.push_back(make_pair("3", 20389)); // Music Videos
+ vec.push_back(make_pair("musicvideos", 20389)); // Music Videos
}
{
if (hasMovies)
- vec.push_back(make_pair("4", 20386)); // Recently Added Movies
+ vec.push_back(make_pair("recentlyaddedmovies", 20386)); // Recently Added Movies
if (hasTvShows)
- vec.push_back(make_pair("5", 20387)); // Recently Added Episodes
+ vec.push_back(make_pair("recentlyaddedepisodes", 20387)); // Recently Added Episodes
if (hasMusicVideos)
- vec.push_back(make_pair("6", 20390)); // Recently Added Music Videos
+ vec.push_back(make_pair("recentlyaddedmusicvideos", 20390)); // Recently Added Music Videos
}
CStdString path = BuildPath();
for (unsigned int i = 0; i < vec.size(); ++i)
+++ /dev/null
-/*
- * Copyright (C) 2005-2013 Team XBMC
- * http://www.xbmc.org
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- */
-
-#include "DirectoryNodeSets.h"
-#include "QueryParams.h"
-#include "video/VideoDatabase.h"
-
-using namespace XFILE::VIDEODATABASEDIRECTORY;
-
-CDirectoryNodeSets::CDirectoryNodeSets(const CStdString& strName, CDirectoryNode* pParent)
- : CDirectoryNode(NODE_TYPE_SETS, strName, pParent)
-{
-
-}
-
-NODE_TYPE CDirectoryNodeSets::GetChildType() const
-{
- return NODE_TYPE_TITLE_MOVIES;
-}
-
-CStdString CDirectoryNodeSets::GetLocalizedName() const
-{
- CVideoDatabase db;
- if (db.Open())
- return db.GetSetById(GetID());
- return "";
-}
-
-bool CDirectoryNodeSets::GetContent(CFileItemList& items) const
-{
- CVideoDatabase videodatabase;
- if (!videodatabase.Open())
- return false;
-
- CQueryParams params;
- CollectQueryParams(params);
-
- bool bSuccess=videodatabase.GetSetsNav(BuildPath(), items, params.GetContentType());
-
- videodatabase.Close();
-
- return bSuccess;
-}
+++ /dev/null
-#pragma once
-/*
- * Copyright (C) 2005-2013 Team XBMC
- * http://www.xbmc.org
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- */
-
-#include "DirectoryNode.h"
-
-namespace XFILE
-{
- namespace VIDEODATABASEDIRECTORY
- {
- class CDirectoryNodeSets : public CDirectoryNode
- {
- public:
- CDirectoryNodeSets(const CStdString& strName, CDirectoryNode* pParent);
- protected:
- virtual NODE_TYPE GetChildType() const;
- virtual bool GetContent(CFileItemList& items) const;
- virtual CStdString GetLocalizedName() const;
- };
- }
-}
-
-
+++ /dev/null
-/*
- * Copyright (C) 2005-2013 Team XBMC
- * http://www.xbmc.org
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- */
-
-#include "DirectoryNodeStudio.h"
-#include "QueryParams.h"
-#include "video/VideoDatabase.h"
-
-using namespace XFILE::VIDEODATABASEDIRECTORY;
-
-CDirectoryNodeStudio::CDirectoryNodeStudio(const CStdString& strName, CDirectoryNode* pParent)
- : CDirectoryNode(NODE_TYPE_STUDIO, strName, pParent)
-{
-
-}
-
-NODE_TYPE CDirectoryNodeStudio::GetChildType() const
-{
- CQueryParams params;
- CollectQueryParams(params);
- if (params.GetContentType() == VIDEODB_CONTENT_MOVIES)
- return NODE_TYPE_TITLE_MOVIES;
- if (params.GetContentType() == VIDEODB_CONTENT_MUSICVIDEOS)
- return NODE_TYPE_TITLE_MUSICVIDEOS;
-
- return NODE_TYPE_TITLE_TVSHOWS;
-}
-
-CStdString CDirectoryNodeStudio::GetLocalizedName() const
-{
- CVideoDatabase db;
- if (db.Open())
- return db.GetStudioById(GetID());
- return "";
-}
-
-bool CDirectoryNodeStudio::GetContent(CFileItemList& items) const
-{
- CVideoDatabase videodatabase;
- if (!videodatabase.Open())
- return false;
-
- CQueryParams params;
- CollectQueryParams(params);
-
- bool bSuccess=videodatabase.GetStudiosNav(BuildPath(), items, params.GetContentType());
-
- videodatabase.Close();
-
- return bSuccess;
-}
+++ /dev/null
-#pragma once
-/*
- * Copyright (C) 2005-2013 Team XBMC
- * http://www.xbmc.org
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- */
-
-#include "DirectoryNode.h"
-
-namespace XFILE
-{
- namespace VIDEODATABASEDIRECTORY
- {
- class CDirectoryNodeStudio : public CDirectoryNode
- {
- public:
- CDirectoryNodeStudio(const CStdString& strName, CDirectoryNode* pParent);
- protected:
- virtual NODE_TYPE GetChildType() const;
- virtual bool GetContent(CFileItemList& items) const;
- virtual CStdString GetLocalizedName() const;
- };
- }
-}
-
-
+++ /dev/null
-/*
- * Copyright (C) 2012-2013 Team XBMC
- * http://www.xbmc.org
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- */
-
-#include "DirectoryNodeTags.h"
-#include "QueryParams.h"
-#include "video/VideoDatabase.h"
-
-using namespace XFILE::VIDEODATABASEDIRECTORY;
-
-CDirectoryNodeTags::CDirectoryNodeTags(const CStdString& strName, CDirectoryNode* pParent)
- : CDirectoryNode(NODE_TYPE_TAGS, strName, pParent)
-{
-
-}
-
-NODE_TYPE CDirectoryNodeTags::GetChildType() const
-{
- CQueryParams params;
- CollectQueryParams(params);
- if (params.GetContentType() == VIDEODB_CONTENT_MOVIES)
- return NODE_TYPE_TITLE_MOVIES;
- if (params.GetContentType() == VIDEODB_CONTENT_MUSICVIDEOS)
- return NODE_TYPE_TITLE_MUSICVIDEOS;
-
- return NODE_TYPE_TITLE_TVSHOWS;
-}
-
-CStdString CDirectoryNodeTags::GetLocalizedName() const
-{
- CVideoDatabase db;
- if (db.Open())
- return db.GetTagById(GetID());
- return "";
-}
-
-bool CDirectoryNodeTags::GetContent(CFileItemList& items) const
-{
- CVideoDatabase videodatabase;
- if (!videodatabase.Open())
- return false;
-
- CQueryParams params;
- CollectQueryParams(params);
-
- bool bSuccess = videodatabase.GetTagsNav(BuildPath(), items, params.GetContentType());
- videodatabase.Close();
-
- return bSuccess;
-}
+++ /dev/null
-#pragma once
-/*
- * Copyright (C) 2012-2013 Team XBMC
- * http://www.xbmc.org
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- */
-
-#include "DirectoryNode.h"
-
-namespace XFILE
-{
- namespace VIDEODATABASEDIRECTORY
- {
- class CDirectoryNodeTags : public CDirectoryNode
- {
- public:
- CDirectoryNodeTags(const CStdString& strName, CDirectoryNode* pParent);
- protected:
- virtual NODE_TYPE GetChildType() const;
- virtual bool GetContent(CFileItemList& items) const;
- virtual CStdString GetLocalizedName() const;
- };
- }
-}
-
-
using namespace XFILE::VIDEODATABASEDIRECTORY;
Node TvShowChildren[] = {
- { NODE_TYPE_GENRE, 1, 135 },
- { NODE_TYPE_TITLE_TVSHOWS, 2, 369 },
- { NODE_TYPE_YEAR, 3, 562 },
- { NODE_TYPE_ACTOR, 4, 344 },
- { NODE_TYPE_STUDIO, 5, 20388 },
- { NODE_TYPE_TAGS, 9, 20459 }
+ { NODE_TYPE_GENRE, "genres", 135 },
+ { NODE_TYPE_TITLE_TVSHOWS, "titles", 369 },
+ { NODE_TYPE_YEAR, "years", 562 },
+ { NODE_TYPE_ACTOR, "actors", 344 },
+ { NODE_TYPE_STUDIO, "studios", 20388 },
+ { NODE_TYPE_TAGS, "tags", 20459 }
};
CDirectoryNodeTvShowsOverview::CDirectoryNodeTvShowsOverview(const CStdString& strName, CDirectoryNode* pParent)
return NODE_TYPE_EPISODES;
for (unsigned int i = 0; i < sizeof(TvShowChildren) / sizeof(Node); ++i)
- if (GetID() == TvShowChildren[i].id)
+ if (GetName().Equals(TvShowChildren[i].id.c_str()))
return TvShowChildren[i].node;
return NODE_TYPE_NONE;
CStdString CDirectoryNodeTvShowsOverview::GetLocalizedName() const
{
for (unsigned int i = 0; i < sizeof(TvShowChildren) / sizeof(Node); ++i)
- if (GetID() == TvShowChildren[i].id)
+ if (GetName().Equals(TvShowChildren[i].id.c_str()))
return g_localizeStrings.Get(TvShowChildren[i].label);
return "";
}
CFileItemPtr pItem(new CFileItem(g_localizeStrings.Get(TvShowChildren[i].label)));
CVideoDbUrl itemUrl = videoUrl;
- CStdString strDir; strDir.Format("%ld/", TvShowChildren[i].id);
+ CStdString strDir; strDir.Format("%s/", TvShowChildren[i].id);
itemUrl.AppendPath(strDir);
pItem->SetPath(itemUrl.ToString());
+++ /dev/null
-/*
- * Copyright (C) 2005-2013 Team XBMC
- * http://www.xbmc.org
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- */
-
-#include "DirectoryNodeYear.h"
-#include "QueryParams.h"
-#include "video/VideoDatabase.h"
-
-using namespace XFILE::VIDEODATABASEDIRECTORY;
-
-CDirectoryNodeYear::CDirectoryNodeYear(const CStdString& strName, CDirectoryNode* pParent)
- : CDirectoryNode(NODE_TYPE_YEAR, strName, pParent)
-{
-
-}
-
-NODE_TYPE CDirectoryNodeYear::GetChildType() const
-{
- CQueryParams params;
- CollectQueryParams(params);
- if (params.GetContentType() == VIDEODB_CONTENT_MOVIES)
- return NODE_TYPE_TITLE_MOVIES;
- if (params.GetContentType() == VIDEODB_CONTENT_MUSICVIDEOS)
- return NODE_TYPE_TITLE_MUSICVIDEOS;
-
- return NODE_TYPE_TITLE_TVSHOWS;
-}
-
-CStdString CDirectoryNodeYear::GetLocalizedName() const
-{
- return GetName();
-}
-
-bool CDirectoryNodeYear::GetContent(CFileItemList& items) const
-{
- CVideoDatabase videodatabase;
- if (!videodatabase.Open())
- return false;
-
- CQueryParams params;
- CollectQueryParams(params);
-
- bool bSuccess=videodatabase.GetYearsNav(BuildPath(), items, params.GetContentType());
-
- videodatabase.Close();
-
- return bSuccess;
-}
+++ /dev/null
-#pragma once
-/*
- * Copyright (C) 2005-2013 Team XBMC
- * http://www.xbmc.org
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- */
-
-#include "DirectoryNode.h"
-
-namespace XFILE
-{
- namespace VIDEODATABASEDIRECTORY
- {
- class CDirectoryNodeYear : public CDirectoryNode
- {
- public:
- CDirectoryNodeYear(const CStdString& strEntryName, CDirectoryNode* pParent);
- protected:
- virtual bool GetContent(CFileItemList& items) const;
- virtual NODE_TYPE GetChildType() const;
- virtual CStdString GetLocalizedName() const;
- };
- }
-}
-
-
SRCS=DirectoryNode.cpp \
- DirectoryNodeActor.cpp \
- DirectoryNodeCountry.cpp \
- DirectoryNodeDirector.cpp \
DirectoryNodeEpisodes.cpp \
- DirectoryNodeGenre.cpp \
+ DirectoryNodeGrouped.cpp \
DirectoryNodeMoviesOverview.cpp \
- DirectoryNodeMusicVideoAlbum.cpp \
DirectoryNodeMusicVideosOverview.cpp \
DirectoryNodeOverview.cpp \
DirectoryNodeRecentlyAddedEpisodes.cpp \
DirectoryNodeRecentlyAddedMusicVideos.cpp \
DirectoryNodeRoot.cpp \
DirectoryNodeSeasons.cpp \
- DirectoryNodeSets.cpp \
- DirectoryNodeStudio.cpp \
- DirectoryNodeTags.cpp \
DirectoryNodeTitleMovies.cpp \
DirectoryNodeTitleMusicVideos.cpp \
DirectoryNodeTitleTvShows.cpp \
DirectoryNodeTvShowsOverview.cpp \
- DirectoryNodeYear.cpp \
QueryParams.cpp \
LIB=videodatabasedirectory.a
*/
#include "QueryParams.h"
+#include "video/VideoDatabase.h"
using namespace XFILE::VIDEODATABASEDIRECTORY;
switch (NodeType)
{
case NODE_TYPE_OVERVIEW:
- m_idContent = idDb;
+ if (strNodeName.Equals("tvshows"))
+ m_idContent = VIDEODB_CONTENT_TVSHOWS;
+ else if (strNodeName.Equals("musicvideos"))
+ m_idContent = VIDEODB_CONTENT_MUSICVIDEOS;
+ else
+ m_idContent = VIDEODB_CONTENT_MOVIES;
break;
case NODE_TYPE_GENRE:
m_idGenre = idDb;
return InternalError;
CMusicDbUrl musicUrl;
- musicUrl.FromString("musicdb://2/");
+ musicUrl.FromString("musicdb://artists/");
int genreID = -1, albumID = -1, songID = -1;
const CVariant &filter = parameterObject["filter"];
if (filter.isMember("genreid"))
int artistID = (int)parameterObject["artistid"].asInteger();
CMusicDbUrl musicUrl;
- if (!musicUrl.FromString("musicdb://2/"))
+ if (!musicUrl.FromString("musicdb://artists/"))
return InternalError;
CMusicDatabase musicdatabase;
return InternalError;
CMusicDbUrl musicUrl;
- musicUrl.FromString("musicdb://3/");
+ musicUrl.FromString("musicdb://albums/");
int artistID = -1, genreID = -1;
const CVariant &filter = parameterObject["filter"];
if (filter.isMember("artistid"))
return InternalError;
CMusicDbUrl musicUrl;
- musicUrl.FromString("musicdb://4/");
+ musicUrl.FromString("musicdb://songs/");
int genreID = -1, albumID = -1, artistID = -1;
const CVariant &filter = parameterObject["filter"];
if (filter.isMember("artistid"))
for (unsigned int index = 0; index < albums.size(); index++)
{
CStdString path;
- path.Format("musicdb://6/%i/", albums[index].idAlbum);
+ path.Format("musicdb://recentlyaddedalbums/%i/", albums[index].idAlbum);
CFileItemPtr item;
FillAlbumItem(albums[index], path, item);
for (unsigned int index = 0; index < albums.size(); index++)
{
CStdString path;
- path.Format("musicdb://7/%i/", albums[index].idAlbum);
+ path.Format("musicdb://recentlyplayedalbums/%i/", albums[index].idAlbum);
CFileItemPtr item;
FillAlbumItem(albums[index], path, item);
return InternalError;
CFileItemList items;
- if (!musicdatabase.GetGenresNav("musicdb://1/", items))
+ if (!musicdatabase.GetGenresNav("musicdb://genres/", items))
return InternalError;
/* need to set strTitle in each item*/
}
if (artistID != -1 || albumID != -1 || genreID != -1)
- success |= musicdatabase.GetSongsNav("musicdb://4/", list, genreID, artistID, albumID);
+ success |= musicdatabase.GetSongsNav("musicdb://songs/", list, genreID, artistID, albumID);
int songID = (int)parameterObject["songid"].asInteger(-1);
if (songID != -1)
return InvalidParams;
CVideoDbUrl videoUrl;
- videoUrl.FromString("videodb://1/2/");
+ videoUrl.FromString("videodb://movies/titles/");
int genreID = -1, year = -1, setID = 0;
const CVariant &filter = parameterObject["filter"];
if (filter.isMember("genreid"))
return InternalError;
CFileItemList items;
- if (!videodatabase.GetSetsNav("videodb://1/7/", items, VIDEODB_CONTENT_MOVIES))
+ if (!videodatabase.GetSetsNav("videodb://movies/sets/", items, VIDEODB_CONTENT_MOVIES))
return InternalError;
HandleFileItemList("setid", false, "sets", items, parameterObject, result);
// Get movies from the set
CFileItemList items;
- if (!videodatabase.GetMoviesNav("videodb://1/2/", items, -1, -1, -1, -1, -1, -1, id))
+ if (!videodatabase.GetMoviesNav("videodb://movies/titles/", items, -1, -1, -1, -1, -1, -1, id))
return InternalError;
return GetAdditionalMovieDetails(parameterObject["movies"], items, result["setdetails"], videodatabase, true);
return InvalidParams;
CVideoDbUrl videoUrl;
- videoUrl.FromString("videodb://2/2/");
+ videoUrl.FromString("videodb://tvshows/titles/");
int genreID = -1, year = -1;
const CVariant &filter = parameterObject["filter"];
if (filter.isMember("genreid"))
int tvshowID = (int)parameterObject["tvshowid"].asInteger();
CStdString strPath;
- strPath.Format("videodb://2/2/%i/", tvshowID);
+ strPath.Format("videodb://tvshows/titles/%i/", tvshowID);
CFileItemList items;
if (!videodatabase.GetSeasonsNav(strPath, items, -1, -1, -1, -1, tvshowID, false))
return InternalError;
int season = (int)parameterObject["season"].asInteger();
CStdString strPath;
- strPath.Format("videodb://2/2/%i/%i/", tvshowID, season);
+ strPath.Format("videodb://tvshows/titles/%i/%i/", tvshowID, season);
CVideoDbUrl videoUrl;
videoUrl.FromString(strPath);
if (tvshowid <= 0)
tvshowid = videodatabase.GetTvShowForEpisode(id);
- CStdString basePath; basePath.Format("videodb://2/2/%ld/%ld/%ld", tvshowid, infos.m_iSeason, id);
+ CStdString basePath; basePath.Format("videodb://tvshows/titles/%ld/%ld/%ld", tvshowid, infos.m_iSeason, id);
pItem->SetPath(basePath);
HandleFileItem("episodeid", true, "episodedetails", pItem, parameterObject, parameterObject["properties"], result, false);
return InvalidParams;
CVideoDbUrl videoUrl;
- videoUrl.FromString("videodb://3/2/");
+ videoUrl.FromString("videodb://musicvideos/titles/");
int genreID = -1, year = -1;
const CVariant &filter = parameterObject["filter"];
if (filter.isMember("artist"))
return InternalError;
CFileItemList items;
- if (!videodatabase.GetRecentlyAddedMoviesNav("videodb://4/", items))
+ if (!videodatabase.GetRecentlyAddedMoviesNav("videodb://recentlyaddedmovies/", items))
return InternalError;
return GetAdditionalMovieDetails(parameterObject, items, result, videodatabase, true);
return InternalError;
CFileItemList items;
- if (!videodatabase.GetRecentlyAddedEpisodesNav("videodb://5/", items))
+ if (!videodatabase.GetRecentlyAddedEpisodesNav("videodb://recentlyaddedepisodes/", items))
return InternalError;
return GetAdditionalEpisodeDetails(parameterObject, items, result, videodatabase, true);
return InternalError;
CFileItemList items;
- if (!videodatabase.GetRecentlyAddedMusicVideosNav("videodb://6/", items))
+ if (!videodatabase.GetRecentlyAddedMusicVideosNav("videodb://recentlyaddedmusicvideos/", items))
return InternalError;
return GetAdditionalMusicVideoDetails(parameterObject, items, result, videodatabase, true);
if (media.Equals("movie"))
{
idContent = VIDEODB_CONTENT_MOVIES;
- strPath += "1";
+ strPath += "movies";
}
else if (media.Equals("tvshow"))
{
idContent = VIDEODB_CONTENT_TVSHOWS;
- strPath += "2";
+ strPath += "tvshows";
}
else if (media.Equals("musicvideo"))
{
idContent = VIDEODB_CONTENT_MUSICVIDEOS;
- strPath += "3";
+ strPath += "musicvideos";
}
- strPath += "/1/";
+ strPath += "/genres/";
CVideoDatabase videodatabase;
if (!videodatabase.Open())
if (database.HasContent(VIDEODB_CONTENT_MUSICVIDEOS))
{
share.strName = g_localizeStrings.Get(20389);
- share.strPath = "videodb://3/";
+ share.strPath = "videodb://musicvideos/";
share.m_strThumbnailImage = CUtil::GetDefaultFolderThumb("DefaultMusicVideos.png");
share.m_iDriveType = CMediaSource::SOURCE_TYPE_LOCAL;
m_sources.push_back(share);
{
CStdString strFileName = m_pDS->fv(song_strFileName).get_asString();
CStdString strExt = URIUtils::GetExtension(strFileName);
- song.strFileName.Format("musicdb://3/%ld/%ld%s", m_pDS->fv(song_idAlbum).get_asInt(), m_pDS->fv(song_idSong).get_asInt(), strExt.c_str());
+ song.strFileName.Format("musicdb://albums/%ld/%ld%s", m_pDS->fv(song_idAlbum).get_asInt(), m_pDS->fv(song_idSong).get_asInt(), strExt.c_str());
}
return song;
while (!m_pDS->eof())
{
CStdString path;
- path.Format("musicdb://2/%ld/", m_pDS->fv(0).get_asInt());
+ path.Format("musicdb://artists/%ld/", m_pDS->fv(0).get_asInt());
CFileItemPtr pItem(new CFileItem(path, true));
CStdString label;
label.Format("[%s] %s", artistLabel.c_str(), m_pDS->fv(1).get_asString());
while (!m_pDS->eof())
{
CFileItemPtr item(new CFileItem);
- GetFileItemFromDataset(item.get(), "musicdb://4/");
+ GetFileItemFromDataset(item.get(), "musicdb://songs/");
items.Add(item);
m_pDS->next();
}
{
CAlbum album = GetAlbumFromDataset(m_pDS.get());
CStdString path;
- path.Format("musicdb://3/%ld/", album.idAlbum);
+ path.Format("musicdb://albums/%ld/", album.idAlbum);
CFileItemPtr pItem(new CFileItem(path, album));
CStdString label;
label.Format("[%s] %s", albumLabel.c_str(), album.strAlbum);
return false;
}
-bool CMusicDatabase::GetYearsNav(const CStdString& strBaseDir, CFileItemList& items)
+bool CMusicDatabase::GetYearsNav(const CStdString& strBaseDir, CFileItemList& items, const Filter &filter /* = Filter() */)
{
try
{
if (NULL == m_pDB.get()) return false;
if (NULL == m_pDS.get()) return false;
+ Filter extFilter = filter;
CMusicDbUrl musicUrl;
- if (!musicUrl.FromString(strBaseDir))
+ SortDescription sorting;
+ if (!musicUrl.FromString(strBaseDir) || !GetFilter(musicUrl, extFilter, sorting))
return false;
// get years from album list
- CStdString strSQL="select distinct iYear from album where iYear <> 0";
+ CStdString strSQL = "SELECT DISTINCT albumview.iYear FROM albumview ";
+ extFilter.AppendWhere("albumview.iYear <> 0");
+
+ if (!BuildSQL(strSQL, extFilter, strSQL))
+ return false;
// run query
CLog::Log(LOGDEBUG, "%s query: %s", __FUNCTION__, strSQL.c_str());
CDirectoryNode::GetDatabaseInfo(strPath, params);
if (params.GetGenreId() != -1) // check genre
{
- strSQL = PrepareSQL("select * from content where strPath='musicdb://1/%i/'",params.GetGenreId());
+ strSQL = PrepareSQL("select * from content where strPath='musicdb://genres/%i/'",params.GetGenreId());
m_pDS->query(strSQL.c_str());
}
if (m_pDS->eof() && params.GetAlbumId() != -1) // check album
{
- strSQL = PrepareSQL("select * from content where strPath='musicdb://3/%i/'",params.GetGenreId());
+ strSQL = PrepareSQL("select * from content where strPath='musicdb://albums/%i/'",params.GetGenreId());
m_pDS->query(strSQL.c_str());
}
if (m_pDS->eof() && params.GetArtistId() != -1) // check artist
{
- strSQL = PrepareSQL("select * from content where strPath='musicdb://2/%i/'",params.GetArtistId());
+ strSQL = PrepareSQL("select * from content where strPath='musicdb://artists/%i/'",params.GetArtistId());
m_pDS->query(strSQL.c_str());
}
if (m_pDS->eof()) // general albums setting
{
- strSQL = PrepareSQL("select * from content where strPath='musicdb://3/'");
+ strSQL = PrepareSQL("select * from content where strPath='musicdb://albums/'");
m_pDS->query(strSQL.c_str());
}
if (m_pDS->eof()) // general artist setting
{
- strSQL = PrepareSQL("select * from content where strPath='musicdb://2/'");
+ strSQL = PrepareSQL("select * from content where strPath='musicdb://artists/'");
m_pDS->query(strSQL.c_str());
}
}
return false;
}
+bool CMusicDatabase::GetItems(const CStdString &strBaseDir, CFileItemList &items, const Filter &filter /* = Filter() */, const SortDescription &sortDescription /* = SortDescription() */)
+{
+ CMusicDbUrl musicUrl;
+ if (!musicUrl.FromString(strBaseDir))
+ return false;
+
+ return GetItems(strBaseDir, musicUrl.GetType(), items, filter, sortDescription);
+}
+
+bool CMusicDatabase::GetItems(const CStdString &strBaseDir, const CStdString &itemType, CFileItemList &items, const Filter &filter /* = Filter() */, const SortDescription &sortDescription /* = SortDescription() */)
+{
+ if (itemType.Equals("genres"))
+ return GetGenresNav(strBaseDir, items, filter);
+ else if (itemType.Equals("years"))
+ return GetYearsNav(strBaseDir, items, filter);
+ else if (itemType.Equals("artists"))
+ return GetArtistsNav(strBaseDir, items, !g_guiSettings.GetBool("musiclibrary.showcompilationartists"), -1, -1, -1, filter, sortDescription);
+ else if (itemType.Equals("albums"))
+ return GetAlbumsByWhere(strBaseDir, filter, items, sortDescription);
+ else if (itemType.Equals("songs"))
+ return GetSongsByWhere(strBaseDir, filter, items, sortDescription);
+
+ return false;
+}
+
+CStdString CMusicDatabase::GetItemById(const CStdString &itemType, int id)
+{
+ if (itemType.Equals("genres"))
+ return GetGenreById(id);
+ else if (itemType.Equals("years"))
+ {
+ CStdString tmp; tmp.Format("%d", id);
+ return tmp;
+ }
+ else if (itemType.Equals("artists"))
+ return GetArtistById(id);
+ else if (itemType.Equals("albums"))
+ return GetAlbumById(id);
+
+ return "";
+}
+
void CMusicDatabase::ExportToXML(const CStdString &xmlFile, bool singleFiles, bool images, bool overwrite)
{
try
return false;
// check if the filter playlist matches the item type
- if (xsp.GetType() != "artists" || xsp.GetType() == type)
+ if (xsp.GetType() == type ||
+ (xsp.GetGroup() == type && !xsp.IsGroupMixed()))
{
std::set<CStdString> playlists;
filter.AppendWhere(xsp.GetWhereClause(*this, playlists));
bool SetPathHash(const CStdString &path, const CStdString &hash);
bool GetPathHash(const CStdString &path, CStdString &hash);
bool GetGenresNav(const CStdString& strBaseDir, CFileItemList& items, const Filter &filter = Filter(), bool countOnly = false);
- bool GetYearsNav(const CStdString& strBaseDir, CFileItemList& items);
+ bool GetYearsNav(const CStdString& strBaseDir, CFileItemList& items, const Filter &filter = Filter());
bool GetArtistsNav(const CStdString& strBaseDir, CFileItemList& items, bool albumArtistsOnly = false, int idGenre = -1, int idAlbum = -1, int idSong = -1, const Filter &filter = Filter(), const SortDescription &sortDescription = SortDescription(), bool countOnly = false);
bool GetCommonNav(const CStdString &strBaseDir, const CStdString &table, const CStdString &labelField, CFileItemList &items, const Filter &filter /* = Filter() */, bool countOnly /* = false */);
bool GetAlbumTypesNav(const CStdString &strBaseDir, CFileItemList &items, const Filter &filter = Filter(), bool countOnly = false);
*/
bool ScraperInUse(const CStdString &scraperID) const;
+ // retrieve a list of items
+ bool GetItems(const CStdString &strBaseDir, CFileItemList &items, const Filter &filter = Filter(), const SortDescription &sortDescription = SortDescription());
+ bool GetItems(const CStdString &strBaseDir, const CStdString &itemType, CFileItemList &items, const Filter &filter = Filter(), const SortDescription &sortDescription = SortDescription());
+ CStdString GetItemById(const CStdString &itemType, int id);
+
void ExportToXML(const CStdString &xmlFile, bool singleFiles = false, bool images=false, bool overwrite=false);
void ImportFromXML(const CStdString &xmlFile);
{
CFileItem item(*m_song);
CStdString path;
- path.Format("musicdb://3/%li",m_albumId);
+ path.Format("musicdb://albums/%li",m_albumId);
item.SetPath(path);
item.m_bIsFolder = true;
window->OnInfo(&item, true);
if (strDirectory.IsEmpty())
{
m_musicDatabase.Open();
- m_musicDatabase.GetAlbumsNav("musicdb://3/", items);
+ m_musicDatabase.GetAlbumsNav("musicdb://albums/", items);
m_musicDatabase.Close();
}
else
if (strDirectory.IsEmpty())
{
m_musicDatabase.Open();
- m_musicDatabase.GetArtistsNav("musicdb://2/", items, false, -1);
+ m_musicDatabase.GetArtistsNav("musicdb://artists/", items, false, -1);
m_musicDatabase.Close();
}
else
if (!m_bStop && (m_flags & SCAN_ONLINE))
{
CStdString strPath;
- strPath.Format("musicdb://2/%u/", *it);
+ strPath.Format("musicdb://artists/%u/", *it);
if (!DownloadArtistInfo(strPath, strArtist, bCanceled)) // assume we want to retry
m_artistsScanned.pop_back();
return songsToAdd.size();
CStdString strPath;
- strPath.Format("musicdb://3/%u/",*it);
+ strPath.Format("musicdb://albums/%u/",*it);
CAlbum album;
m_musicDatabase.GetAlbumInfo(*it, album, NULL);
CStdString strTempAlbum(strAlbum);
CStdString strTempArtist(strArtist);
long idAlbum = m_musicdatabase.GetAlbumByName(strAlbum,strArtist);
- strPath.Format("musicdb://3/%d/",idAlbum);
+ strPath.Format("musicdb://albums/%d/",idAlbum);
bool bCanceled(false);
bool needsRefresh(true);
CStdString strPath;
CStdString strTempArtist(strArtist);
long idArtist = m_musicdatabase.GetArtistByName(strArtist);
- strPath.Format("musicdb://2/%u/",idArtist);
+ strPath.Format("musicdb://artists/%u/",idArtist);
bool bCanceled(false);
bool needsRefresh(true);
CStdString CGUIWindowMusicNav::GetQuickpathName(const CStdString& strPath) const
{
- if (strPath.Equals("musicdb://1/"))
+ if (strPath.Equals("musicdb://genres/") || strPath.Equals("musicdb://1/"))
return "Genres";
- else if (strPath.Equals("musicdb://2/"))
+ else if (strPath.Equals("musicdb://artists/") || strPath.Equals("musicdb://2/"))
return "Artists";
- else if (strPath.Equals("musicdb://3/"))
+ else if (strPath.Equals("musicdb://albums/") || strPath.Equals("musicdb://3/"))
return "Albums";
- else if (strPath.Equals("musicdb://4/"))
+ else if (strPath.Equals("musicdb://songs/") || strPath.Equals("musicdb://4/"))
return "Songs";
- else if (strPath.Equals("musicdb://5/"))
+ else if (strPath.Equals("musicdb://top100/") || strPath.Equals("musicdb://5/"))
return "Top100";
- else if (strPath.Equals("musicdb://5/2/"))
+ else if (strPath.Equals("musicdb://top100/songs/") || strPath.Equals("musicdb://5/2/"))
return "Top100Songs";
- else if (strPath.Equals("musicdb://5/1/"))
+ else if (strPath.Equals("musicdb://top100/albums/") || strPath.Equals("musicdb://5/1/"))
return "Top100Albums";
- else if (strPath.Equals("musicdb://6/"))
+ else if (strPath.Equals("musicdb://recentlyaddedalbums/") || strPath.Equals("musicdb://6/"))
return "RecentlyAddedAlbums";
- else if (strPath.Equals("musicdb://7/"))
+ else if (strPath.Equals("musicdb://recentlyplayedalbums/") || strPath.Equals("musicdb://7/"))
return "RecentlyPlayedAlbums";
- else if (strPath.Equals("musicdb://8/"))
+ else if (strPath.Equals("musicdb://compilations/") || strPath.Equals("musicdb://8/"))
return "Compilations";
- else if (strPath.Equals("musicdb://9/"))
+ else if (strPath.Equals("musicdb://years/") || strPath.Equals("musicdb://9/"))
return "Years";
- else if (strPath.Equals("musicdb://10/"))
+ else if (strPath.Equals("musicdb://singles/") || strPath.Equals("musicdb://10/"))
return "Singles";
else if (strPath.Equals("special://musicplaylists/"))
return "Playlists";
{
if (!item->m_bIsFolder) // music video
buttons.Add(CONTEXT_BUTTON_INFO, 20393);
- if (item->GetPath().Left(14).Equals("videodb://3/4/") &&
- item->GetPath().size() > 14 && item->m_bIsFolder)
+ if (StringUtils::StartsWith(item->GetPath(), "videodb://musicvideos/artist/") && item->m_bIsFolder)
{
long idArtist = m_musicdatabase.GetArtistByName(m_vecItems->Get(itemNumber)->GetLabel());
if (idArtist > - 1)
return CGUIWindowMusicBase::OnContextButton(itemNumber,button);
// music videos - artists
- if (item->GetPath().Left(14).Equals("videodb://3/4/"))
+ if (StringUtils::StartsWith(item->GetPath(), "videodb://musicvideos/artists/"))
{
long idArtist = m_musicdatabase.GetArtistByName(item->GetLabel());
if (idArtist == -1)
return false;
- CStdString path; path.Format("musicdb://2/%ld/", idArtist);
+ CStdString path; path.Format("musicdb://artists/%ld/", idArtist);
CArtist artist;
m_musicdatabase.GetArtistInfo(idArtist,artist,false);
*item = CFileItem(artist);
}
// music videos - albums
- if (item->GetPath().Left(14).Equals("videodb://3/5/"))
+ if (StringUtils::StartsWith(item->GetPath(), "videodb://musicvideos/albums/"))
{
long idAlbum = m_musicdatabase.GetAlbumByName(item->GetLabel());
if (idAlbum == -1)
return false;
- CStdString path; path.Format("musicdb://3/%ld/", idAlbum);
+ CStdString path; path.Format("musicdb://albums/%ld/", idAlbum);
CAlbum album;
m_musicdatabase.GetAlbumInfo(idAlbum,album,NULL);
*item = CFileItem(path,album);
CStdString strPath;
CVideoDatabase database;
database.Open();
- strPath.Format("videodb://3/4/%ld/",database.GetMatchingMusicVideo(StringUtils::Join(item->GetMusicInfoTag()->GetArtist(), g_advancedSettings.m_musicItemSeparator)));
+ strPath.Format("videodb://musicvideos/artist/%ld/",database.GetMatchingMusicVideo(StringUtils::Join(item->GetMusicInfoTag()->GetArtist(), g_advancedSettings.m_musicItemSeparator)));
g_windowManager.ActivateWindow(WINDOW_VIDEO_NAV,strPath);
return true;
}
CDirectoryNode::GetDatabaseInfo(item->GetPath(), params);
CONTENT_TYPE content = CONTENT_ALBUMS;
if (params.GetAlbumId() != -1)
- path.Format("musicdb://3/%i/",params.GetAlbumId());
+ path.Format("musicdb://albums/%i/",params.GetAlbumId());
else if (params.GetArtistId() != -1)
{
- path.Format("musicdb://2/%i/",params.GetArtistId());
+ path.Format("musicdb://artists/%i/",params.GetArtistId());
content = CONTENT_ARTISTS;
}
- if (m_vecItems->GetPath().Equals("musicdb://1/") || item->GetPath().Equals("musicdb://2/"))
+ if (m_vecItems->GetPath().Equals("musicdb://genres/") || item->GetPath().Equals("musicdb://artists/"))
{
content = CONTENT_ARTISTS;
}
CStdString CGUIWindowMusicNav::GetStartFolder(const CStdString &dir)
{
if (dir.Equals("Genres"))
- return "musicdb://1/";
+ return "musicdb://genres/";
else if (dir.Equals("Artists"))
- return "musicdb://2/";
+ return "musicdb://artists/";
else if (dir.Equals("Albums"))
- return "musicdb://3/";
+ return "musicdb://albums/";
else if (dir.Equals("Singles"))
- return "musicdb://10/";
+ return "musicdb://singles/";
else if (dir.Equals("Songs"))
- return "musicdb://4/";
+ return "musicdb://songs/";
else if (dir.Equals("Top100"))
- return "musicdb://5/";
+ return "musicdb://top100/";
else if (dir.Equals("Top100Songs"))
- return "musicdb://5/1/";
+ return "musicdb://top100/songs/";
else if (dir.Equals("Top100Albums"))
- return "musicdb://5/2/";
+ return "musicdb://top100/albums/";
else if (dir.Equals("RecentlyAddedAlbums"))
- return "musicdb://6/";
+ return "musicdb://recentlyaddedalbums/";
else if (dir.Equals("RecentlyPlayedAlbums"))
- return "musicdb://7/";
+ return "musicdb://recentlyplayedalbums/";
else if (dir.Equals("Compilations"))
- return "musicdb://8/";
+ return "musicdb://compilations/";
else if (dir.Equals("Years"))
- return "musicdb://9/";
+ return "musicdb://years/";
return CGUIWindowMusicBase::GetStartFolder(dir);
}
object.m_Creator = StringUtils::Join(tag.GetAlbumArtist(), g_advancedSettings.m_musicItemSeparator);
object.m_MiscInfo.original_track_number = tag.GetTrackNumber();
if(tag.GetDatabaseId() >= 0) {
- object.m_ReferenceID = NPT_String::Format("musicdb://4/%i%s", tag.GetDatabaseId(), URIUtils::GetExtension(tag.GetURL()).c_str());
+ object.m_ReferenceID = NPT_String::Format("musicdb://songs/%i%s", tag.GetDatabaseId(), URIUtils::GetExtension(tag.GetURL()).c_str());
}
if (object.m_ReferenceID == object.m_ObjectID)
object.m_ReferenceID = "";
object.m_ObjectClass.type = "object.item.videoItem.musicVideoClip";
object.m_Creator = StringUtils::Join(tag.m_artist, g_advancedSettings.m_videoItemSeparator);
object.m_Title = tag.m_strTitle;
- object.m_ReferenceID = NPT_String::Format("videodb://3/2/%i", tag.m_iDbId);
+ object.m_ReferenceID = NPT_String::Format("videodb://musicvideos/titles/%i", tag.m_iDbId);
} else if (tag.m_type == "movie") {
object.m_ObjectClass.type = "object.item.videoItem.movie";
object.m_Title = tag.m_strTitle;
object.m_Date = NPT_String::FromInteger(tag.m_iYear) + "-01-01";
- object.m_ReferenceID = NPT_String::Format("videodb://1/2/%i", tag.m_iDbId);
+ object.m_ReferenceID = NPT_String::Format("videodb://movies/titles/%i", tag.m_iDbId);
} else {
object.m_ObjectClass.type = "object.item.videoItem.videoBroadcast";
object.m_Recorded.program_title = "S" + ("0" + NPT_String::FromInteger(tag.m_iSeason)).Right(2);
object.m_Title = object.m_Recorded.series_title + " - " + object.m_Recorded.program_title;
object.m_Date = tag.m_firstAired.GetAsDBDate();
if(tag.m_iSeason != -1)
- object.m_ReferenceID = NPT_String::Format("videodb://2/0/%i", tag.m_iDbId);
+ object.m_ReferenceID = NPT_String::Format("videodb://tvshows/0/%i", tag.m_iDbId);
}
}
NPT_UInt32 CUPnPServer::m_MaxReturnedItems = 0;
-const char* audio_containers[] = { "musicdb://1/", "musicdb://2/", "musicdb://3/",
- "musicdb://4/", "musicdb://6/", "musicdb://9/",
- "musicdb://10/" };
+const char* audio_containers[] = { "musicdb://genres/", "musicdb://artists/", "musicdb://albums/",
+ "musicdb://songs/", "musicdb://recentlyaddedalbums/", "musicdb://years/",
+ "musicdb://singles/" };
-const char* video_containers[] = { "videodb://1/2/", "videodb://2/2/", "videodb://4/",
- "videodb://5/" };
+const char* video_containers[] = { "videodb://movies/titles/", "videodb://tvshows/titles/",
+ "videodb://recentlyaddedmovies/", "videodb://recentlyaddedepisodes/" };
/*----------------------------------------------------------------------
| CUPnPServer::CUPnPServer
if (!db.Open()) return;
int show_id = db.GetTvShowForEpisode(item_id);
int season_id = db.GetSeasonForEpisode(item_id);
- UpdateContainer(StringUtils::Format("videodb://2/2/%d/", show_id));
- UpdateContainer(StringUtils::Format("videodb://2/2/%d/%d/?tvshowid=%d", show_id, season_id, show_id));
- UpdateContainer("videodb://5/");
+ UpdateContainer(StringUtils::Format("videodb://tvshows/titles/%d/", show_id));
+ UpdateContainer(StringUtils::Format("videodb://tvshows/titles/%d/%d/?tvshowid=%d", show_id, season_id, show_id));
+ UpdateContainer("videodb://recentlyaddedepisodes/");
}
else if(item_type == "tvshow") {
- UpdateContainer("videodb://2/2/");
- UpdateContainer("videodb://5/");
+ UpdateContainer("videodb://tvshows/titles/");
+ UpdateContainer("videodb://recentlyaddedepisodes/");
}
else if(item_type == "movie") {
- UpdateContainer("videodb://1/2/");
- UpdateContainer("videodb://4/");
+ UpdateContainer("videodb://movies/titles/");
+ UpdateContainer("videodb://recentlyaddedmovies/");
}
else if(item_type == "musicvideo") {
- UpdateContainer("videodb://4/");
+ UpdateContainer("videodb://recentlyaddedmusicvideos/");
}
}
else if (flag == AudioLibrary && item_type == "song") {
CAlbum album;
if (!db.Open()) return;
if (db.GetAlbumFromSong(item_id, album)) {
- UpdateContainer(StringUtils::Format("musicdb://3/%ld", album.idAlbum));
- UpdateContainer("musicdb://4/");
- UpdateContainer("musicdb://6/");
+ UpdateContainer(StringUtils::Format("musicdb://albums/%ld", album.idAlbum));
+ UpdateContainer("musicdb://songs/");
+ UpdateContainer("musicdb://recentlyaddedalbums/");
}
}
}
// Xbox 360 asking for photos
} else if (id == "107") {
// Sonos uses 107 for artists root container id
- id = "musicdb://2/";
+ id = "musicdb://artists/";
} else if (id == "7") {
// Sonos uses 7 for albums root container id
- id = "musicdb://3/";
+ id = "musicdb://albums/";
} else if (id == "4") {
// Sonos uses 4 for tracks root container id
- id = "musicdb://4/";
+ id = "musicdb://songs/";
}
CLog::Log(LOGDEBUG, "UPnP Translated id to '%s'", (const char*)id);
count = count?count-1:0;
// genre
- if (id.StartsWith("musicdb://1/")) {
+ if (id.StartsWith("musicdb://genres/")) {
// all tracks of all genres
if (count == 1)
id += "-1/-1/-1/";
// all tracks of a specific genre of a specfic artist
else if (count == 3)
id += "-1/";
- } else if (id.StartsWith("musicdb://2/")) {
+ } else if (id.StartsWith("musicdb://artists/")) {
// all tracks by all artists
if (count == 1)
id += "-1/-1/";
// all tracks of a specific artist
else if (count == 2)
id += "-1/";
- } else if (id.StartsWith("musicdb://3/")) {
+ } else if (id.StartsWith("musicdb://albums/")) {
// all albums ?
if (count == 1) id += "-1/";
}
if (genre.GetLength() > 0) {
// all tracks by genre filtered by artist and/or album
CStdString strPath;
- strPath.Format("musicdb://1/%ld/%ld/%ld/",
+ strPath.Format("musicdb://genres/%ld/%ld/%ld/",
database.GetGenreByName((const char*)genre),
database.GetArtistByName((const char*)artist), // will return -1 if no artist
database.GetAlbumByName((const char*)album)); // will return -1 if no album
} else if (artist.GetLength() > 0) {
// all tracks by artist name filtered by album if passed
CStdString strPath;
- strPath.Format("musicdb://2/%ld/%ld/",
+ strPath.Format("musicdb://artists/%ld/%ld/",
database.GetArtistByName((const char*)artist),
database.GetAlbumByName((const char*)album)); // will return -1 if no album
} else if (album.GetLength() > 0) {
// all tracks by album name
CStdString strPath;
- strPath.Format("musicdb://3/%ld/",
+ strPath.Format("musicdb://albums/%ld/",
database.GetAlbumByName((const char*)album));
return OnBrowseDirectChildren(action, strPath.c_str(), filter, starting_index, requested_count, sort_criteria, context);
}
// browse all songs
- return OnBrowseDirectChildren(action, "musicdb://4/", filter, starting_index, requested_count, sort_criteria, context);
+ return OnBrowseDirectChildren(action, "musicdb://songs/", filter, starting_index, requested_count, sort_criteria, context);
} else if (NPT_String(search_criteria).Find("object.container.album.musicAlbum") >= 0) {
// sonos filters by genre
NPT_String genre = FindSubCriteria(search_criteria, "upnp:genre");
if (genre.GetLength() > 0) {
CStdString strPath;
- strPath.Format("musicdb://1/%ld/%ld/",
+ strPath.Format("musicdb://genres/%ld/%ld/",
database.GetGenreByName((const char*)genre),
database.GetArtistByName((const char*)artist)); // no artist should return -1
return OnBrowseDirectChildren(action, strPath.c_str(), filter, starting_index, requested_count, sort_criteria, context);
} else if (artist.GetLength() > 0) {
CStdString strPath;
- strPath.Format("musicdb://2/%ld/",
+ strPath.Format("musicdb://artists/%ld/",
database.GetArtistByName((const char*)artist));
return OnBrowseDirectChildren(action, strPath.c_str(), filter, starting_index, requested_count, sort_criteria, context);
}
// all albums
- return OnBrowseDirectChildren(action, "musicdb://3/", filter, starting_index, requested_count, sort_criteria, context);
+ return OnBrowseDirectChildren(action, "musicdb://albums/", filter, starting_index, requested_count, sort_criteria, context);
} else if (NPT_String(search_criteria).Find("object.container.person.musicArtist") >= 0) {
// Sonos filters by genre
NPT_String genre = FindSubCriteria(search_criteria, "upnp:genre");
CMusicDatabase database;
database.Open();
CStdString strPath;
- strPath.Format("musicdb://1/%ld/", database.GetGenreByName((const char*)genre));
+ strPath.Format("musicdb://genres/%ld/", database.GetGenreByName((const char*)genre));
return OnBrowseDirectChildren(action, strPath.c_str(), filter, starting_index, requested_count, sort_criteria, context);
}
- return OnBrowseDirectChildren(action, "musicdb://2/", filter, starting_index, requested_count, sort_criteria, context);
+ return OnBrowseDirectChildren(action, "musicdb://artists/", filter, starting_index, requested_count, sort_criteria, context);
} else if (NPT_String(search_criteria).Find("object.container.genre.musicGenre") >= 0) {
- return OnBrowseDirectChildren(action, "musicdb://1/", filter, starting_index, requested_count, sort_criteria, context);
+ return OnBrowseDirectChildren(action, "musicdb://genres/", filter, starting_index, requested_count, sort_criteria, context);
} else if (NPT_String(search_criteria).Find("object.container.playlistContainer") >= 0) {
return OnBrowseDirectChildren(action, "special://musicplaylists/", filter, starting_index, requested_count, sort_criteria, context);
} else if (NPT_String(search_criteria).Find("object.item.videoItem") >= 0) {
return NPT_SUCCESS;
}
- if (!database.GetMoviesNav("videodb://1/2/", items)) {
+ if (!database.GetMoviesNav("videodb://movies/titles/", items)) {
action->SetError(800, "Internal Error");
return NPT_SUCCESS;
}
itemsall.Append(items);
items.Clear();
- // TODO - set proper base url for this
- if (!database.GetEpisodesByWhere("videodb://2/0/", "", items, false)) {
+ if (!database.GetEpisodesByWhere("videodb://tvshows/titles/", "", items)) {
action->SetError(800, "Internal Error");
return NPT_SUCCESS;
}
#define NUM_OPERATORS sizeof(operators) / sizeof(operatorField)
+typedef struct
+{
+ std::string name;
+ Field field;
+ bool canMix;
+ int localizedString;
+} group;
+
+static const group groups[] = { { "", FieldUnknown, false, 571 },
+ { "none", FieldNone, false, 231 },
+ { "sets", FieldSet, true, 20434 },
+ { "genres", FieldGenre, false, 135 },
+ { "years", FieldYear, false, 652 },
+ { "actors", FieldActor, false, 344 },
+ { "directors", FieldDirector, false, 20348 },
+ { "writers", FieldWriter, false, 20418 },
+ { "studios", FieldStudio, false, 20388 },
+ { "countries", FieldCountry, false, 20451 },
+ { "artists", FieldArtist, false, 133 },
+ { "albums", FieldAlbum, false, 132 },
+ { "tags", FieldTag, false, 20459 },
+ };
+
+#define NUM_GROUPS sizeof(groups) / sizeof(group)
+
CSmartPlaylistRule::CSmartPlaylistRule()
{
m_field = FieldNone;
return "contains";
}
+Field CSmartPlaylistRule::TranslateGroup(const char *group)
+{
+ for (unsigned int i = 0; i < NUM_GROUPS; i++)
+ {
+ if (StringUtils::EqualsNoCase(group, groups[i].name))
+ return groups[i].field;
+ }
+
+ return FieldUnknown;
+}
+
+CStdString CSmartPlaylistRule::TranslateGroup(Field group)
+{
+ for (unsigned int i = 0; i < NUM_GROUPS; i++)
+ {
+ if (group == groups[i].field)
+ return groups[i].name;
+ }
+
+ return "";
+}
+
CStdString CSmartPlaylistRule::GetLocalizedField(Field field)
{
for (unsigned int i = 0; i < NUM_FIELDS; i++)
return orders;
}
+std::vector<Field> CSmartPlaylistRule::GetGroups(const CStdString &type)
+{
+ vector<Field> groups;
+ groups.push_back(FieldUnknown);
+
+ if (type == "artists")
+ groups.push_back(FieldGenre);
+ else if (type == "albums")
+ groups.push_back(FieldYear);
+ if (type == "movies")
+ {
+ groups.push_back(FieldNone);
+ groups.push_back(FieldSet);
+ groups.push_back(FieldGenre);
+ groups.push_back(FieldYear);
+ groups.push_back(FieldActor);
+ groups.push_back(FieldDirector);
+ groups.push_back(FieldWriter);
+ groups.push_back(FieldStudio);
+ groups.push_back(FieldCountry);
+ groups.push_back(FieldTag);
+ }
+ else if (type == "tvshows")
+ {
+ groups.push_back(FieldGenre);
+ groups.push_back(FieldYear);
+ groups.push_back(FieldActor);
+ groups.push_back(FieldDirector);
+ groups.push_back(FieldStudio);
+ groups.push_back(FieldTag);
+ }
+ else if (type == "episodes")
+ {
+ groups.push_back(FieldActor);
+ groups.push_back(FieldDirector);
+ groups.push_back(FieldWriter);
+ }
+ else if (type == "musicvideos")
+ {
+ groups.push_back(FieldArtist);
+ groups.push_back(FieldAlbum);
+ groups.push_back(FieldGenre);
+ groups.push_back(FieldYear);
+ groups.push_back(FieldDirector);
+ groups.push_back(FieldStudio);
+ groups.push_back(FieldTag);
+ }
+
+ return groups;
+}
+
CStdString CSmartPlaylistRule::GetLocalizedOperator(SEARCH_OPERATOR oper)
{
for (unsigned int i = 0; i < NUM_OPERATORS; i++)
return g_localizeStrings.Get(16018);
}
+CStdString CSmartPlaylistRule::GetLocalizedGroup(Field group)
+{
+ for (unsigned int i = 0; i < NUM_GROUPS; i++)
+ {
+ if (group == groups[i].field)
+ return g_localizeStrings.Get(groups[i].localizedString);
+ }
+
+ return g_localizeStrings.Get(groups[0].localizedString);
+}
+
+bool CSmartPlaylistRule::CanGroupMix(Field group)
+{
+ for (unsigned int i = 0; i < NUM_GROUPS; i++)
+ {
+ if (group == groups[i].field)
+ return groups[i].canMix;
+ }
+
+ return false;
+}
+
CStdString CSmartPlaylistRule::GetLocalizedRule() const
{
CStdString rule;
if (obj.isMember("rules"))
m_ruleCombination.Load(obj["rules"]);
+ if (obj.isMember("group") && obj["group"].isMember("type") && obj["group"]["type"].isString())
+ {
+ m_group = obj["group"]["type"].asString();
+ if (obj["group"].isMember("mixed") && obj["group"]["mixed"].isBoolean())
+ m_groupMixed = obj["group"]["mixed"].asBoolean();
+ }
+
// now any limits
if (obj.isMember("limit") && (obj["limit"].isInteger() || obj["limit"].isUnsignedInteger()) && obj["limit"].asUnsignedInteger() > 0)
m_limit = (unsigned int)obj["limit"].asUnsignedInteger();
ruleNode = ruleNode->NextSibling("rule");
}
+ const TiXmlElement *groupElement = root->FirstChildElement("group");
+ if (groupElement != NULL && groupElement->FirstChild() != NULL)
+ {
+ m_group = groupElement->FirstChild()->ValueStr();
+ if (groupElement->QueryBoolAttribute("mixed", &m_groupMixed) != TIXML_SUCCESS)
+ m_groupMixed = false;
+ }
+
// now any limits
// format is <limit>25</limit>
XMLUtils::GetUInt(root, "limit", m_limit);
for (CSmartPlaylistRules::const_iterator it = m_ruleCombination.m_rules.begin(); it != m_ruleCombination.m_rules.end(); ++it)
it->Save(pRoot);
+ // add <group> tag if necessary
+ if (!m_group.empty())
+ {
+ TiXmlElement nodeGroup("group");
+ if (m_groupMixed)
+ nodeGroup.SetAttribute("mixed", "true");
+ TiXmlText group(m_group.c_str());
+ nodeGroup.InsertEndChild(group);
+ pRoot->InsertEndChild(nodeGroup);
+ }
+
// add <limit> tag
if (m_limit)
XMLUtils::SetInt(pRoot, "limit", m_limit);
if (m_ruleCombination.Save(rulesObj))
obj["rules"] = rulesObj;
+ // add "group"
+ if (!m_group.empty())
+ {
+ obj["group"]["type"] = m_group;
+ obj["group"]["mixed"] = m_groupMixed;
+ }
+
// add "limit"
if (full && m_limit)
obj["limit"] = m_limit;
m_orderField = SortByNone;
m_orderDirection = SortOrderNone;
m_playlistType = "songs"; // sane default
+ m_group.clear();
+ m_groupMixed = false;
}
void CSmartPlaylist::SetName(const CStdString &name)
static CStdString TranslateOrder(SortBy order);
static CStdString GetField(Field field, const CStdString& strType);
static CStdString TranslateOperator(SEARCH_OPERATOR oper);
+ static Field TranslateGroup(const char *group);
+ static CStdString TranslateGroup(Field group);
static CStdString GetLocalizedField(Field field);
static CStdString GetLocalizedOperator(SEARCH_OPERATOR oper);
+ static CStdString GetLocalizedGroup(Field group);
+ static bool CanGroupMix(Field group);
+
static std::vector<Field> GetFields(const CStdString &type);
static std::vector<SortBy> GetOrders(const CStdString &type);
+ static std::vector<Field> GetGroups(const CStdString &type);
static FIELD_TYPE GetFieldType(Field field);
static bool IsFieldBrowseable(Field field);
bool GetOrderAscending() const { return m_orderDirection != SortOrderDescending; };
SortOrder GetOrderDirection() const { return m_orderDirection; }
+ void SetGroup(const CStdString &group) { m_group = group; }
+ const CStdString& GetGroup() const { return m_group; }
+ void SetGroupMixed(bool mixed) { m_groupMixed = mixed; }
+ bool IsGroupMixed() const { return m_groupMixed; }
+
/*! \brief get the where clause for a playlist
We handle playlists inside playlists separately in order to ensure we don't introduce infinite loops
by playlist A including playlist B which also (perhaps via other playlists) then includes playlistA.
unsigned int m_limit;
SortBy m_orderField;
SortOrder m_orderDirection;
+ CStdString m_group;
+ bool m_groupMixed;
CXBMCTinyXML m_xmlDoc;
};
typedef enum {
// special fields used during sorting
+ FieldUnknown = -1,
FieldNone = 0,
FieldSort, // used to store the string to use for sorting
FieldSortSpecial, // whether the item needs special handling (0 = no, 1 = sort on top, 2 = sort on bottom)
handle->SetTitle(g_localizeStrings.Get(12349));
// movies
- db.GetMoviesByWhere("videodb://1/2/", CDatabase::Filter(), items);
+ db.GetMoviesByWhere("videodb://movies/titles/", CDatabase::Filter(), items);
for (int i = 0; i < items.Size(); i++)
{
CFileItemPtr item = items[i];
items.Clear();
// music videos
- db.GetMusicVideosNav("videodb://3/2/", items, false);
+ db.GetMusicVideosNav("videodb://musicvideos/titles/", items, false);
for (int i = 0; i < items.Size(); i++)
{
CFileItemPtr item = items[i];
// tvshows
// count the number of episodes
- db.GetTvShowsNav("videodb://2/2/", items);
+ db.GetTvShowsNav("videodb://tvshows/titles/", items);
for (int i = 0; i < items.Size(); i++)
{
CFileItemPtr item = items[i];
// now episodes...
CFileItemList items2;
- db.GetEpisodesByWhere("videodb://2/2/-1/-1/", db.PrepareSQL("episodeview.idShow=%d", item->GetVideoInfoTag()->m_iDbId), items2);
+ db.GetEpisodesByWhere("videodb://tvshows/titles/-1/-1/", db.PrepareSQL("episodeview.idShow=%d", item->GetVideoInfoTag()->m_iDbId), items2);
for (int j = 0; j < items2.Size(); j++)
{
handle->SetProgress(j, items2.Size());
items.Clear();
// now sets
- db.GetSetsNav("videodb://1/7/", items, VIDEODB_CONTENT_MOVIES);
+ db.GetSetsNav("videodb://movies/sets/", items, VIDEODB_CONTENT_MOVIES);
for (int i = 0; i < items.Size(); i++)
{
CFileItemPtr item = items[i];
if (!db.GetArtForItem(item->GetVideoInfoTag()->m_iDbId, item->GetVideoInfoTag()->m_type, artwork))
{ // grab the first movie from this set
CFileItemList items2;
- db.GetMoviesNav("videodb://1/2/", items2, -1, -1, -1, -1, -1, -1, item->GetVideoInfoTag()->m_iDbId);
+ db.GetMoviesNav("videodb://movies/titles/", items2, -1, -1, -1, -1, -1, -1, item->GetVideoInfoTag()->m_iDbId);
if (items2.Size() > 1)
{
if (db.GetArtForItem(items2[0]->GetVideoInfoTag()->m_iDbId, items2[0]->GetVideoInfoTag()->m_type, artwork))
// now actors
if (g_guiSettings.GetBool("videolibrary.actorthumbs"))
{
- db.GetActorsNav("videodb://1/4/", items, VIDEODB_CONTENT_MOVIES);
- db.GetActorsNav("videodb://2/4/", items, VIDEODB_CONTENT_TVSHOWS);
- db.GetActorsNav("videodb://2/4/", items, VIDEODB_CONTENT_EPISODES);
- db.GetActorsNav("videodb://3/4/", items, VIDEODB_CONTENT_MUSICVIDEOS);
+ db.GetActorsNav("videodb://movies/titles/", items, VIDEODB_CONTENT_MOVIES);
+ db.GetActorsNav("videodb://tvshows/titles/", items, VIDEODB_CONTENT_TVSHOWS);
+ db.GetActorsNav("videodb://tvshows/titles/", items, VIDEODB_CONTENT_EPISODES);
+ db.GetActorsNav("videodb://musicvideos/titles/", items, VIDEODB_CONTENT_MUSICVIDEOS);
for (int i = 0; i < items.Size(); i++)
{
CFileItemPtr item = items[i];
pItem->GetVideoInfoTag()->m_iDbId = set->first;
pItem->GetVideoInfoTag()->m_type = "set";
- std::string basePath = StringUtils::Format("videodb://1/7/%ld/", set->first);
+ std::string basePath = StringUtils::Format("videodb://movies/sets/%ld/", set->first);
CVideoDbUrl videoUrl;
if (!videoUrl.FromString(basePath))
pItem->SetPath(basePath);
videodatabase.Open();
- if (videodatabase.GetRecentlyAddedMoviesNav("videodb://4/", items, NUM_ITEMS))
+ if (videodatabase.GetRecentlyAddedMoviesNav("videodb://recentlyaddedmovies/", items, NUM_ITEMS))
{
for (; i < items.Size(); ++i)
{
i = 0;
CFileItemList TVShowItems;
- if (videodatabase.GetRecentlyAddedEpisodesNav("videodb://5/", TVShowItems, NUM_ITEMS))
+ if (videodatabase.GetRecentlyAddedEpisodesNav("videodb://recentlyaddedepisodes/", TVShowItems, NUM_ITEMS))
{
for (; i < TVShowItems.Size(); ++i)
{
i = 0;
CFileItemList MusicVideoItems;
- if (videodatabase.GetRecentlyAddedMusicVideosNav("videodb://6/", MusicVideoItems, NUM_ITEMS))
+ if (videodatabase.GetRecentlyAddedMusicVideosNav("videodb://recentlyaddedmusicvideos/", MusicVideoItems, NUM_ITEMS))
{
for (; i < MusicVideoItems.Size(); ++i)
{
musicdatabase.Open();
- if (musicdatabase.GetRecentlyAddedAlbumSongs("musicdb://4/", musicItems, NUM_ITEMS))
+ if (musicdatabase.GetRecentlyAddedAlbumSongs("musicdb://songs/", musicItems, NUM_ITEMS))
{
long idAlbum = -1;
CStdString strAlbumThumb;
value.Format("%i", i + 1);
strThumb = musicdatabase.GetArtForItem(album.idAlbum, "album", "thumb");
strFanart = musicdatabase.GetArtistArtForItem(album.idAlbum, "album", "fanart");
- strDBpath.Format("musicdb://3/%i/", album.idAlbum);
+ strDBpath.Format("musicdb://albums/%i/", album.idAlbum);
strSQLAlbum.Format("idAlbum=%i", album.idAlbum);
CStdString strArtist = musicdatabase.GetSingleValue("albumview", "strArtists", strSQLAlbum);
"LEFT JOIN actors d ON d.idActor=directorlinkmovie.idDirector";
filter.where = PrepareSQL("a.strActor='%s' OR d.strActor='%s'", strActor.c_str(), strActor.c_str());
filter.group = "movieview.idMovie";
- GetMoviesByWhere("videodb://1/2/", filter, items);
+ GetMoviesByWhere("videodb://movies/titles/", filter, items);
}
void CVideoDatabase::GetTvShowsByActor(const CStdString& strActor, CFileItemList& items)
"LEFT JOIN actors d ON d.idActor=directorlinktvshow.idDirector";
filter.where = PrepareSQL("a.strActor='%s' OR d.strActor='%s'", strActor.c_str(), strActor.c_str());
filter.group = "tvshowview.idShow";
- GetTvShowsByWhere("videodb://2/2/", filter, items);
+ GetTvShowsByWhere("videodb://tvshows/titles/", filter, items);
}
void CVideoDatabase::GetEpisodesByActor(const CStdString& strActor, CFileItemList& items)
"LEFT JOIN actors d ON d.idActor=directorlinkepisode.idDirector";
filter.where = PrepareSQL("a.strActor='%s' OR d.strActor='%s'", strActor.c_str(), strActor.c_str());
filter.group = "episodeview.idEpisode";
- GetEpisodesByWhere("videodb://2/2/", filter, items);
+ GetEpisodesByWhere("videodb://tvshows/titles/", filter, items);
}
void CVideoDatabase::GetMusicVideosByArtist(const CStdString& strArtist, CFileItemList& items)
Filter filter;
filter.where = PrepareSQL("sets.idSet=%d", idSet);
CFileItemList items;
- if (!GetSetsByWhere("videodb://1/7/", filter, items) ||
+ if (!GetSetsByWhere("videodb://movies/sets/", filter, items) ||
items.Size() != 1 ||
!items[0]->HasVideoInfoTag())
return false;
return false;
}
-bool CVideoDatabase::GetSetsNav(const CStdString& strBaseDir, CFileItemList& items, int idContent, bool ignoreSingleMovieSets /* = false */)
+bool CVideoDatabase::GetSetsNav(const CStdString& strBaseDir, CFileItemList& items, int idContent /* = -1 */, const Filter &filter /* = Filter() */, bool ignoreSingleMovieSets /* = false */)
{
if (idContent != VIDEODB_CONTENT_MOVIES)
return false;
- Filter filter;
return GetSetsByWhere(strBaseDir, filter, items, ignoreSingleMovieSets);
}
movieFilter.join = PrepareSQL("join movielinktvshow on movielinktvshow.idMovie=movieview.idMovie");
movieFilter.where = PrepareSQL("movielinktvshow.idShow %s", strIn.c_str());
CFileItemList movieItems;
- GetMoviesByWhere("videodb://1/2/", movieFilter, movieItems);
+ GetMoviesByWhere("videodb://movies/titles/", movieFilter, movieItems);
if (movieItems.Size() > 0)
items.Append(movieItems);
return success;
}
+bool CVideoDatabase::GetItems(const CStdString &strBaseDir, CFileItemList &items, const Filter &filter /* = Filter() */, const SortDescription &sortDescription /* = SortDescription() */)
+{
+ CVideoDbUrl videoUrl;
+ if (!videoUrl.FromString(strBaseDir))
+ return false;
+
+ return GetItems(strBaseDir, videoUrl.GetType(), videoUrl.GetItemType(), items, filter, sortDescription);
+}
+
+bool CVideoDatabase::GetItems(const CStdString &strBaseDir, const CStdString &mediaType, const CStdString &itemType, CFileItemList &items, const Filter &filter /* = Filter() */, const SortDescription &sortDescription /* = SortDescription() */)
+{
+ VIDEODB_CONTENT_TYPE contentType;
+ if (mediaType.Equals("movies"))
+ contentType = VIDEODB_CONTENT_MOVIES;
+ else if (mediaType.Equals("tvshows"))
+ {
+ if (itemType.Equals("episodes"))
+ contentType = VIDEODB_CONTENT_EPISODES;
+ else
+ contentType = VIDEODB_CONTENT_TVSHOWS;
+ }
+ else if (mediaType.Equals("musicvideos"))
+ contentType = VIDEODB_CONTENT_MUSICVIDEOS;
+ else
+ return false;
+
+ return GetItems(strBaseDir, contentType, itemType, items, filter, sortDescription);
+}
+
+bool CVideoDatabase::GetItems(const CStdString &strBaseDir, VIDEODB_CONTENT_TYPE mediaType, const CStdString &itemType, CFileItemList &items, const Filter &filter /* = Filter() */, const SortDescription &sortDescription /* = SortDescription() */)
+{
+ if (itemType.Equals("movies") && (mediaType == VIDEODB_CONTENT_MOVIES || mediaType == VIDEODB_CONTENT_MOVIE_SETS))
+ return GetMoviesByWhere(strBaseDir, filter, items, sortDescription);
+ else if (itemType.Equals("tvshows") && mediaType == VIDEODB_CONTENT_TVSHOWS)
+ return GetTvShowsByWhere(strBaseDir, filter, items, sortDescription);
+ else if (itemType.Equals("musicvideos") && mediaType == VIDEODB_CONTENT_MUSICVIDEOS)
+ return GetMusicVideosByWhere(strBaseDir, filter, items, true, sortDescription);
+ else if (itemType.Equals("episodes") && mediaType == VIDEODB_CONTENT_EPISODES)
+ return GetEpisodesByWhere(strBaseDir, filter, items, true, sortDescription);
+ else if (itemType.Equals("seasons") && mediaType == VIDEODB_CONTENT_TVSHOWS)
+ return GetSeasonsNav(strBaseDir, items);
+ else if (itemType.Equals("genres"))
+ return GetGenresNav(strBaseDir, items, mediaType, filter);
+ else if (itemType.Equals("years"))
+ return GetYearsNav(strBaseDir, items, mediaType, filter);
+ else if (itemType.Equals("actors"))
+ return GetActorsNav(strBaseDir, items, mediaType, filter);
+ else if (itemType.Equals("directors"))
+ return GetDirectorsNav(strBaseDir, items, mediaType, filter);
+ else if (itemType.Equals("writers"))
+ return GetWritersNav(strBaseDir, items, mediaType, filter);
+ else if (itemType.Equals("studios"))
+ return GetStudiosNav(strBaseDir, items, mediaType, filter);
+ else if (itemType.Equals("sets"))
+ return GetSetsNav(strBaseDir, items, mediaType, filter);
+ else if (itemType.Equals("countries"))
+ return GetCountriesNav(strBaseDir, items, mediaType, filter);
+ else if (itemType.Equals("tags"))
+ return GetTagsNav(strBaseDir, items, mediaType, filter);
+ else if (itemType.Equals("artists") && mediaType == VIDEODB_CONTENT_MUSICVIDEOS)
+ return GetActorsNav(strBaseDir, items, mediaType, filter);
+ else if (itemType.Equals("albums") && mediaType == VIDEODB_CONTENT_MUSICVIDEOS)
+ return GetMusicVideoAlbumsNav(strBaseDir, items, -1, filter);
+
+ return false;
+}
+
+CStdString CVideoDatabase::GetItemById(const CStdString &itemType, int id)
+{
+ if (itemType.Equals("genres"))
+ return GetGenreById(id);
+ else if (itemType.Equals("years"))
+ {
+ CStdString tmp; tmp.Format("%d", id);
+ return tmp;
+ }
+ else if (itemType.Equals("actors") || itemType.Equals("directors") || itemType.Equals("artists"))
+ return GetPersonById(id);
+ else if (itemType.Equals("studios"))
+ return GetStudioById(id);
+ else if (itemType.Equals("sets"))
+ return GetSetById(id);
+ else if (itemType.Equals("countries"))
+ return GetCountryById(id);
+ else if (itemType.Equals("tags"))
+ return GetTagById(id);
+ else if (itemType.Equals("albums"))
+ return GetMusicVideoAlbumById(id);
+
+ return "";
+}
+
bool CVideoDatabase::GetMoviesNav(const CStdString& strBaseDir, CFileItemList& items,
int idGenre /* = -1 */, int idYear /* = -1 */, int idActor /* = -1 */, int idDirector /* = -1 */,
int idStudio /* = -1 */, int idCountry /* = -1 */, int idSet /* = -1 */, int idTag /* = -1 */,
movieFilter.join = PrepareSQL("join movielinktvshow on movielinktvshow.idMovie=movieview.idMovie");
movieFilter.where = PrepareSQL("movielinktvshow.idShow %s", strIn.c_str());
CFileItemList movieItems;
- GetMoviesByWhere("videodb://1/2/", movieFilter, movieItems);
+ GetMoviesByWhere("videodb://movies/titles/", movieFilter, movieItems);
if (movieItems.Size() > 0)
items.Append(movieItems);
CFileItemPtr pItem(new CFileItem(m_pDS->fv("genre.strGenre").get_asString()));
CStdString strDir;
strDir.Format("%ld/", m_pDS->fv("genre.idGenre").get_asInt());
- pItem->SetPath("videodb://1/1/"+ strDir);
+ pItem->SetPath("videodb://movies/genres/"+ strDir);
pItem->m_bIsFolder=true;
items.Add(pItem);
m_pDS->next();
CFileItemPtr pItem(new CFileItem(m_pDS->fv("country.strCountry").get_asString()));
CStdString strDir;
strDir.Format("%ld/", m_pDS->fv("country.idCountry").get_asInt());
- pItem->SetPath("videodb://1/1/"+ strDir);
+ pItem->SetPath("videodb://movies/genres/"+ strDir);
pItem->m_bIsFolder=true;
items.Add(pItem);
m_pDS->next();
CFileItemPtr pItem(new CFileItem(m_pDS->fv("genre.strGenre").get_asString()));
CStdString strDir;
strDir.Format("%ld/", m_pDS->fv("genre.idGenre").get_asInt());
- pItem->SetPath("videodb://2/1/"+ strDir);
+ pItem->SetPath("videodb://tvshows/genres/"+ strDir);
pItem->m_bIsFolder=true;
items.Add(pItem);
m_pDS->next();
CFileItemPtr pItem(new CFileItem(m_pDS->fv("actors.strActor").get_asString()));
CStdString strDir;
strDir.Format("%ld/", m_pDS->fv("actors.idActor").get_asInt());
- pItem->SetPath("videodb://1/4/"+ strDir);
+ pItem->SetPath("videodb://movies/actors/"+ strDir);
pItem->m_bIsFolder=true;
items.Add(pItem);
m_pDS->next();
CFileItemPtr pItem(new CFileItem(m_pDS->fv("actors.strActor").get_asString()));
CStdString strDir;
strDir.Format("%ld/", m_pDS->fv("actors.idActor").get_asInt());
- pItem->SetPath("videodb://2/4/"+ strDir);
+ pItem->SetPath("videodb://tvshows/actors/"+ strDir);
pItem->m_bIsFolder=true;
items.Add(pItem);
m_pDS->next();
CFileItemPtr pItem(new CFileItem(m_pDS->fv("actors.strActor").get_asString()));
CStdString strDir;
strDir.Format("%ld/", m_pDS->fv("actors.idActor").get_asInt());
- pItem->SetPath("videodb://3/4/"+ strDir);
+ pItem->SetPath("videodb://musicvideos/artist/"+ strDir);
pItem->m_bIsFolder=true;
items.Add(pItem);
m_pDS->next();
CFileItemPtr pItem(new CFileItem(m_pDS->fv("genre.strGenre").get_asString()));
CStdString strDir;
strDir.Format("%ld/", m_pDS->fv("genre.idGenre").get_asInt());
- pItem->SetPath("videodb://3/1/"+ strDir);
+ pItem->SetPath("videodb://musicvideos/genres/"+ strDir);
pItem->m_bIsFolder=true;
items.Add(pItem);
m_pDS->next();
CFileItemPtr pItem(new CFileItem(m_pDS->fv(0).get_asString()));
CStdString strDir;
strDir.Format("%ld", m_pDS->fv(1).get_asInt());
- pItem->SetPath("videodb://3/2/"+ strDir);
+ pItem->SetPath("videodb://musicvideos/titles/"+ strDir);
pItem->m_bIsFolder=false;
items.Add(pItem);
m_pDS->next();
return false;
}
*item->GetVideoInfoTag() = GetDetailsForMusicVideo(m_pDS);
- CStdString path; path.Format("videodb://3/2/%ld",item->GetVideoInfoTag()->m_iDbId);
+ CStdString path; path.Format("videodb://musicvideos/titles/%ld",item->GetVideoInfoTag()->m_iDbId);
item->SetPath(path);
idSong = m_pDS->fv("idMVideo").get_asInt();
item->SetLabel(item->GetVideoInfoTag()->m_strTitle);
CFileItemPtr pItem(new CFileItem(m_pDS->fv(1).get_asString()));
CStdString path;
if (setId <= 0)
- path.Format("videodb://1/2/%i", movieId);
+ path.Format("videodb://movies/titles/%i", movieId);
else
- path.Format("videodb://1/7/%i/%i", setId, movieId);
+ path.Format("videodb://movies/sets/%i/%i", setId, movieId);
pItem->SetPath(path);
pItem->m_bIsFolder=false;
items.Add(pItem);
CFileItemPtr pItem(new CFileItem(m_pDS->fv(1).get_asString()));
CStdString strDir;
- strDir.Format("2/2/%ld/", m_pDS->fv("tvshow.idShow").get_asInt());
+ strDir.Format("tvshows/titles/%ld/", m_pDS->fv("tvshow.idShow").get_asInt());
pItem->SetPath("videodb://"+ strDir);
pItem->m_bIsFolder=true;
}
CFileItemPtr pItem(new CFileItem(m_pDS->fv(1).get_asString()+" ("+m_pDS->fv(4).get_asString()+")"));
- CStdString path; path.Format("videodb://2/2/%ld/%ld/%ld",m_pDS->fv("episode.idShow").get_asInt(),m_pDS->fv(2).get_asInt(),m_pDS->fv(0).get_asInt());
+ CStdString path; path.Format("videodb://tvshows/titles/%ld/%ld/%ld",m_pDS->fv("episode.idShow").get_asInt(),m_pDS->fv(2).get_asInt(),m_pDS->fv(0).get_asInt());
pItem->SetPath(path);
pItem->m_bIsFolder=false;
items.Add(pItem);
// Alternative searching - not quite as fast though due to
// retrieving all information
// Filter filter(PrepareSQL("c%02d like '%s%%' or c%02d like '%% %s%%'", VIDEODB_ID_MUSICVIDEO_TITLE, strSearch.c_str(), VIDEODB_ID_MUSICVIDEO_TITLE, strSearch.c_str()));
-// GetMusicVideosByWhere("videodb://3/2/", filter, items);
+// GetMusicVideosByWhere("videodb://musicvideos/titles/", filter, items);
CStdString strSQL;
try
// Filter filter;
// filter.where = PrepareSQL("c%02d like '%s%%' or c%02d like '%% %s%%'", VIDEODB_ID_EPISODE_PLOT, strSearch.c_str(), VIDEODB_ID_EPISODE_PLOT, strSearch.c_str());
// filter.where += PrepareSQL("or c%02d like '%s%%' or c%02d like '%% %s%%'", VIDEODB_ID_EPISODE_TITLE, strSearch.c_str(), VIDEODB_ID_EPISODE_TITLE, strSearch.c_str());
-// GetEpisodesByWhere("videodb://2/2/", filter, items);
+// GetEpisodesByWhere("videodb://tvshows/titles/", filter, items);
// return;
CStdString strSQL;
}
CFileItemPtr pItem(new CFileItem(m_pDS->fv(1).get_asString()+" ("+m_pDS->fv(4).get_asString()+")"));
- CStdString path; path.Format("videodb://2/2/%ld/%ld/%ld",m_pDS->fv("episode.idShow").get_asInt(),m_pDS->fv(2).get_asInt(),m_pDS->fv(0).get_asInt());
+ CStdString path; path.Format("videodb://tvshows/titles/%ld/%ld/%ld",m_pDS->fv("episode.idShow").get_asInt(),m_pDS->fv(2).get_asInt(),m_pDS->fv(0).get_asInt());
pItem->SetPath(path);
pItem->m_bIsFolder=false;
items.Add(pItem);
}
CFileItemPtr pItem(new CFileItem(m_pDS->fv(1).get_asString()));
- CStdString path; path.Format("videodb://1/2/%ld", m_pDS->fv(0).get_asInt());
+ CStdString path; path.Format("videodb://movies/titles/%ld", m_pDS->fv(0).get_asInt());
pItem->SetPath(path);
pItem->m_bIsFolder=false;
strDir.Format("%ld/", m_pDS->fv("directorlinkmovie.idDirector").get_asInt());
CFileItemPtr pItem(new CFileItem(m_pDS->fv("actors.strActor").get_asString()));
- pItem->SetPath("videodb://1/5/"+ strDir);
+ pItem->SetPath("videodb://movies/directors/"+ strDir);
pItem->m_bIsFolder=true;
items.Add(pItem);
m_pDS->next();
strDir.Format("%ld/", m_pDS->fv("directorlinktvshow.idDirector").get_asInt());
CFileItemPtr pItem(new CFileItem(m_pDS->fv("actors.strActor").get_asString()));
- pItem->SetPath("videodb://2/5/"+ strDir);
+ pItem->SetPath("videodb://tvshows/studios/"+ strDir);
pItem->m_bIsFolder=true;
items.Add(pItem);
m_pDS->next();
strDir.Format("%ld/", m_pDS->fv("directorlinkmusicvideo.idDirector").get_asInt());
CFileItemPtr pItem(new CFileItem(m_pDS->fv("actors.strActor").get_asString()));
- pItem->SetPath("videodb://3/5/"+ strDir);
+ pItem->SetPath("videodb://musicvideos/albums/"+ strDir);
pItem->m_bIsFolder=true;
items.Add(pItem);
m_pDS->next();
{
// get all tvshows
CFileItemList items;
- GetTvShowsByWhere("videodb://2/2/", "", items);
+ GetTvShowsByWhere("videodb://tvshows/titles/", "", items);
CStdString showPath = URIUtils::AddFileToFolder(path, "shows");
CDirectory::Create(showPath);
for (int i = 0; i < items.Size(); i++)
{ // right - grab the episodes and dump them as well
CFileItemList episodes;
Filter filter(PrepareSQL("idShow=%i", items[i]->GetVideoInfoTag()->m_iDbId));
- GetEpisodesByWhere("videodb://2/2/", filter, episodes);
+ GetEpisodesByWhere("videodb://tvshows/titles/", filter, episodes);
for (int i = 0; i < episodes.Size(); i++)
{
CVideoInfoTag *tag = episodes[i]->GetVideoInfoTag();
}
// get all movies
items.Clear();
- GetMoviesByWhere("videodb://1/2/", "", items);
+ GetMoviesByWhere("videodb://movies/titles/", "", items);
CStdString moviePath = URIUtils::AddFileToFolder(path, "movies");
CDirectory::Create(moviePath);
for (int i = 0; i < items.Size(); i++)
if (content == "movies")
{
Filter filter(PrepareSQL("c%02d=%d", VIDEODB_ID_PARENTPATHID, pathID));
- GetMoviesByWhere("videodb://1/2/", filter, items);
+ GetMoviesByWhere("videodb://movies/titles/", filter, items);
}
else if (content == "episodes")
{
Filter filter(PrepareSQL("c%02d=%d", VIDEODB_ID_EPISODE_PARENTPATHID, pathID));
- GetEpisodesByWhere("videodb://2/2/", filter, items);
+ GetEpisodesByWhere("videodb://tvshows/titles/", filter, items);
}
else if (content == "tvshows")
{
Filter filter(PrepareSQL("c%02d=%d", VIDEODB_ID_TV_PARENTPATHID, pathID));
- GetTvShowsByWhere("videodb://2/2/", filter, items);
+ GetTvShowsByWhere("videodb://tvshows/titles/", filter, items);
}
else if (content == "musicvideos")
{
Filter filter(PrepareSQL("c%02d=%d", VIDEODB_ID_MUSICVIDEO_PARENTPATHID, pathID));
- GetMusicVideosByWhere("videodb://3/2/", filter, items);
+ GetMusicVideosByWhere("videodb://musicvideos/titles/", filter, items);
}
for (int i = 0; i < items.Size(); i++)
items[i]->SetPath(items[i]->GetVideoInfoTag()->m_basePath);
// check if the filter playlist matches the item type
if (xsp.GetType() == itemType ||
- // handle episode listings with videodb://2/2/ which get the rest
+ (xsp.GetGroup() == itemType && !xsp.IsGroupMixed()) ||
+ // handle episode listings with videodb://tvshows/titles/ which get the rest
// of the path (season and episodeid) appended later
- (xsp.GetType() == "episodes" && itemType == "tvshows"))
+ (xsp.GetType() == "episodes" && itemType == "tvshows"))
{
std::set<CStdString> playlists;
filter.AppendWhere(xsp.GetWhereClause(*this, playlists));
bool GetActorsNav(const CStdString& strBaseDir, CFileItemList& items, int idContent=-1, const Filter &filter = Filter(), bool countOnly = false);
bool GetDirectorsNav(const CStdString& strBaseDir, CFileItemList& items, int idContent=-1, const Filter &filter = Filter(), bool countOnly = false);
bool GetWritersNav(const CStdString& strBaseDir, CFileItemList& items, int idContent=-1, const Filter &filter = Filter(), bool countOnly = false);
- bool GetSetsNav(const CStdString& strBaseDir, CFileItemList& items, int idContent=-1, bool ignoreSingleMovieSets = false);
+ bool GetSetsNav(const CStdString& strBaseDir, CFileItemList& items, int idContent=-1, const Filter &filter = Filter(), bool ignoreSingleMovieSets = false);
bool GetTagsNav(const CStdString& strBaseDir, CFileItemList& items, int idContent=-1, const Filter &filter = Filter(), bool countOnly = false);
bool GetMusicVideoAlbumsNav(const CStdString& strBaseDir, CFileItemList& items, int idArtist, const Filter &filter = Filter(), bool countOnly = false);
// retrieve sorted and limited items
bool GetSortedVideos(MediaType mediaType, const CStdString& strBaseDir, const SortDescription &sortDescription, CFileItemList& items, const Filter &filter = Filter());
+ // retrieve a list of items
+ bool GetItems(const CStdString &strBaseDir, CFileItemList &items, const Filter &filter = Filter(), const SortDescription &sortDescription = SortDescription());
+ bool GetItems(const CStdString &strBaseDir, const CStdString &mediaType, const CStdString &itemType, CFileItemList &items, const Filter &filter = Filter(), const SortDescription &sortDescription = SortDescription());
+ bool GetItems(const CStdString &strBaseDir, VIDEODB_CONTENT_TYPE mediaType, const CStdString &itemType, CFileItemList &items, const Filter &filter = Filter(), const SortDescription &sortDescription = SortDescription());
+ CStdString GetItemById(const CStdString &itemType, int id);
+
// partymode
int GetMusicVideoCount(const CStdString& strWhere);
unsigned int GetMusicVideoIDs(const CStdString& strWhere, std::vector<std::pair<int,int> > &songIDs);
if (!m_movieItem->GetVideoInfoTag()->m_strEpisodeGuide.IsEmpty())
{
CStdString strPath;
- strPath.Format("videodb://2/2/%i/",m_movieItem->GetVideoInfoTag()->m_iDbId);
+ strPath.Format("videodb://tvshows/titles/%i/",m_movieItem->GetVideoInfoTag()->m_iDbId);
Close();
g_windowManager.ActivateWindow(WINDOW_VIDEO_NAV,strPath);
return;
#define CONTROL_STACK 7
#define CONTROL_BTNSCAN 8
+#define PROPERTY_GROUP_BY "group.by"
+#define PROPERTY_GROUP_MIXED "group.mixed"
+
CGUIWindowVideoBase::CGUIWindowVideoBase(int id, const CStdString &xmlFile)
: CGUIMediaWindow(id, xmlFile)
{
{
CGUIMediaWindow::GetGroupedItems(items);
- CQueryParams params;
- CVideoDatabaseDirectory dir;
- dir.GetQueryParams(items.GetPath(), params);
- VIDEODATABASEDIRECTORY::NODE_TYPE nodeType = CVideoDatabaseDirectory::GetDirectoryChildType(m_strFilterPath);
- if (items.GetContent().Equals("movies") && params.GetSetId() <= 0 &&
- nodeType == NODE_TYPE_TITLE_MOVIES &&
- g_guiSettings.GetBool("videolibrary.groupmoviesets"))
+ std::string group;
+ bool mixed = false;
+ if (items.HasProperty(PROPERTY_GROUP_BY))
+ group = items.GetProperty(PROPERTY_GROUP_BY).asString();
+ if (items.HasProperty(PROPERTY_GROUP_MIXED))
+ mixed = items.GetProperty(PROPERTY_GROUP_MIXED).asBoolean();
+
+ // group == "none" completely supresses any grouping
+ if (!StringUtils::EqualsNoCase(group, "none"))
{
- CFileItemList groupedItems;
- if (GroupUtils::Group(GroupBySet, m_strFilterPath, items, groupedItems, GroupAttributeIgnoreSingleItems))
+ CQueryParams params;
+ CVideoDatabaseDirectory dir;
+ dir.GetQueryParams(items.GetPath(), params);
+ VIDEODATABASEDIRECTORY::NODE_TYPE nodeType = CVideoDatabaseDirectory::GetDirectoryChildType(m_strFilterPath);
+ if (items.GetContent().Equals("movies") && params.GetSetId() <= 0 &&
+ nodeType == NODE_TYPE_TITLE_MOVIES &&
+ (g_guiSettings.GetBool("videolibrary.groupmoviesets") || (StringUtils::EqualsNoCase(group, "sets") && mixed)))
{
- items.ClearItems();
- items.Append(groupedItems);
+ CFileItemList groupedItems;
+ if (GroupUtils::Group(GroupBySet, m_strFilterPath, items, groupedItems, GroupAttributeIgnoreSingleItems))
+ {
+ items.ClearItems();
+ items.Append(groupedItems);
+ }
}
}
pSelect->SetHeading(530); // Select Genre
pSelect->Reset();
CFileItemList items;
- if (!CDirectory::GetDirectory("videodb://1/1/", items))
+ if (!CDirectory::GetDirectory("videodb://movies/genres/", items))
return;
pSelect->SetItems(&items);
pSelect->EnableButton(true, 531); // New Genre
CStdString CGUIWindowVideoNav::GetQuickpathName(const CStdString& strPath) const
{
- if (strPath.Equals("videodb://1/1/"))
+ if (strPath.Equals("videodb://movies/genres/") || strPath.Equals("videodb://1/1/"))
return "MovieGenres";
- else if (strPath.Equals("videodb://1/2/"))
+ else if (strPath.Equals("videodb://movies/titles/") || strPath.Equals("videodb://1/2/"))
return "MovieTitles";
- else if (strPath.Equals("videodb://1/3/"))
+ else if (strPath.Equals("videodb://movies/years/") || strPath.Equals("videodb://1/3/"))
return "MovieYears";
- else if (strPath.Equals("videodb://1/4/"))
+ else if (strPath.Equals("videodb://movies/actors/") || strPath.Equals("videodb://1/4/"))
return "MovieActors";
- else if (strPath.Equals("videodb://1/5/"))
+ else if (strPath.Equals("videodb://movies/directors/") || strPath.Equals("videodb://1/5/"))
return "MovieDirectors";
- else if (strPath.Equals("videodb://1/6/"))
+ else if (strPath.Equals("videodb://movies/studios/") || strPath.Equals("videodb://1/6/"))
return "MovieStudios";
- else if (strPath.Equals("videodb://1/7/"))
+ else if (strPath.Equals("videodb://movies/sets/") || strPath.Equals("videodb://1/7/"))
return "MovieSets";
- else if (strPath.Equals("videodb://1/8/"))
+ else if (strPath.Equals("videodb://movies/countries/") || strPath.Equals("videodb://1/8/"))
return "MovieCountries";
- else if (strPath.Equals("videodb://1/9/"))
+ else if (strPath.Equals("videodb://movies/tags/") || strPath.Equals("videodb://1/9/"))
return "MovieTags";
- else if (strPath.Equals("videodb://1/"))
+ else if (strPath.Equals("videodb://movies/") || strPath.Equals("videodb://1/"))
return "Movies";
- else if (strPath.Equals("videodb://2/1/"))
+ else if (strPath.Equals("videodb://tvshows/genres/") || strPath.Equals("videodb://2/1/"))
return "TvShowGenres";
- else if (strPath.Equals("videodb://2/2/"))
+ else if (strPath.Equals("videodb://tvshows/titles/") || strPath.Equals("videodb://2/2/"))
return "TvShowTitles";
- else if (strPath.Equals("videodb://2/3/"))
+ else if (strPath.Equals("videodb://tvshows/years/") || strPath.Equals("videodb://2/3/"))
return "TvShowYears";
- else if (strPath.Equals("videodb://2/4/"))
+ else if (strPath.Equals("videodb://tvshows/actors/") || strPath.Equals("videodb://2/4/"))
return "TvShowActors";
- else if (strPath.Equals("videodb://2/5/"))
+ else if (strPath.Equals("videodb://tvshows/studios/") || strPath.Equals("videodb://2/9/"))
return "TvShowStudios";
- else if (strPath.Equals("videodb://2/9/"))
+ else if (strPath.Equals("videodb://tvshows/tags/") || strPath.Equals("videodb://2/"))
return "TvShowTags";
- else if (strPath.Equals("videodb://2/"))
+ else if (strPath.Equals("videodb://tvshows/") || strPath.Equals("videodb://2/"))
return "TvShows";
- else if (strPath.Equals("videodb://3/1/"))
+ else if (strPath.Equals("videodb://musicvideos/genres/") || strPath.Equals("videodb://3/1/"))
return "MusicVideoGenres";
- else if (strPath.Equals("videodb://3/2/"))
+ else if (strPath.Equals("videodb://musicvideos/titles/") || strPath.Equals("videodb://3/2/"))
return "MusicVideoTitles";
- else if (strPath.Equals("videodb://3/3/"))
+ else if (strPath.Equals("videodb://musicvideos/years/") || strPath.Equals("videodb://3/3/"))
return "MusicVideoYears";
- else if (strPath.Equals("videodb://3/4/"))
+ else if (strPath.Equals("videodb://musicvideos/artist/") || strPath.Equals("videodb://3/4/"))
return "MusicVideoArtists";
- else if (strPath.Equals("videodb://3/5/"))
+ else if (strPath.Equals("videodb://musicvideos/albums/") || strPath.Equals("videodb://3/5/"))
return "MusicVideoDirectors";
- else if (strPath.Equals("videodb://3/9/"))
+ else if (strPath.Equals("videodb://musicvideos/tags/") || strPath.Equals("videodb://3/9/"))
return "MusicVideoTags";
- else if (strPath.Equals("videodb://3/"))
+ else if (strPath.Equals("videodb://musicvideos/") || strPath.Equals("videodb://3/"))
return "MusicVideos";
- else if (strPath.Equals("videodb://4/"))
+ else if (strPath.Equals("videodb://recentlyaddedmovies/") || strPath.Equals("videodb://4/"))
return "RecentlyAddedMovies";
- else if (strPath.Equals("videodb://5/"))
+ else if (strPath.Equals("videodb://recentlyaddedepisodes/") || strPath.Equals("videodb://5/"))
return "RecentlyAddedEpisodes";
- else if (strPath.Equals("videodb://6/"))
+ else if (strPath.Equals("videodb://recentlyaddedmusicvideos/") || strPath.Equals("videodb://6/"))
return "RecentlyAddedMusicVideos";
else if (strPath.Equals("special://videoplaylists/"))
return "Playlists";
!pItem->GetPath().Left(9).Equals("newtag://"))
CGUIWindowVideoBase::OnDeleteItem(pItem);
}
- else if (pItem->GetPath().Left(14).Equals("videodb://1/7/") &&
- pItem->GetPath().size() > 14 && pItem->m_bIsFolder)
+ else if (StringUtils::StartsWith(pItem->GetPath(), "videodb://movies/sets/") &&
+ pItem->GetPath().size() > 22 && pItem->m_bIsFolder)
{
CGUIDialogYesNo* pDialog = (CGUIDialogYesNo*)g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO);
pDialog->SetHeading(432);
m_database.DeleteSet(params.GetSetId());
}
}
- else if (m_vecItems->GetContent() == "tags" &&
- pItem->GetPath().size() > 14 && pItem->m_bIsFolder)
+ else if (m_vecItems->GetContent() == "tags" && pItem->m_bIsFolder)
{
CGUIDialogYesNo* pDialog = (CGUIDialogYesNo*)g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO);
pDialog->SetHeading(432);
if (node == NODE_TYPE_SEASONS && item->m_bIsFolder)
buttons.Add(CONTEXT_BUTTON_SET_SEASON_ART, 13511);
- if (item->GetPath().Left(14).Equals("videodb://1/7/") && item->GetPath().size() > 14 && item->m_bIsFolder) // sets
+ if (StringUtils::StartsWith(item->GetPath(), "videodb://movies/sets/") && item->GetPath().size() > 22 && item->m_bIsFolder) // sets
{
buttons.Add(CONTEXT_BUTTON_EDIT, 16105);
buttons.Add(CONTEXT_BUTTON_SET_MOVIESET_ART, 13511);
buttons.Add(CONTEXT_BUTTON_DELETE, 646);
}
- if (m_vecItems->GetContent() == "tags" && item->GetPath().size() > 14 && item->m_bIsFolder) // tags
+ if (m_vecItems->GetContent() == "tags" && item->m_bIsFolder) // tags
{
CVideoDbUrl videoUrl;
if (videoUrl.FromString(item->GetPath()))
if (node == NODE_TYPE_ACTOR && !dir.IsAllItem(item->GetPath()) && item->m_bIsFolder)
{
- if (m_vecItems->GetPath().Left(11).Equals("videodb://3")) // mvids
+ if (StringUtils::StartsWith(m_vecItems->GetPath(), "videodb://musicvideos")) // mvids
buttons.Add(CONTEXT_BUTTON_SET_ARTIST_THUMB, 13359);
else
buttons.Add(CONTEXT_BUTTON_SET_ACTOR_THUMB, 20403);
CStdString strPath;
CMusicDatabase database;
database.Open();
- strPath.Format("musicdb://2/%ld/",database.GetArtistByName(StringUtils::Join(m_vecItems->Get(itemNumber)->GetVideoInfoTag()->m_artist, g_advancedSettings.m_videoItemSeparator)));
+ strPath.Format("musicdb://artists/%ld/",database.GetArtistByName(StringUtils::Join(m_vecItems->Get(itemNumber)->GetVideoInfoTag()->m_artist, g_advancedSettings.m_videoItemSeparator)));
g_windowManager.ActivateWindow(WINDOW_MUSIC_NAV,strPath);
return true;
}
CStdString strPath;
CMusicDatabase database;
database.Open();
- strPath.Format("musicdb://3/%ld/",database.GetAlbumByName(m_vecItems->Get(itemNumber)->GetVideoInfoTag()->m_strAlbum));
+ strPath.Format("musicdb://albums/%ld/",database.GetAlbumByName(m_vecItems->Get(itemNumber)->GetVideoInfoTag()->m_strAlbum));
g_windowManager.ActivateWindow(WINDOW_MUSIC_NAV,strPath);
return true;
}
}
else
{
- m_database.GetTvShowsNav("videodb://2/2",list);
+ m_database.GetTvShowsNav("videodb://tvshows/titles",list);
// remove already linked shows
vector<int> ids;
CStdString CGUIWindowVideoNav::GetStartFolder(const CStdString &dir)
{
if (dir.Equals("MovieGenres"))
- return "videodb://1/1/";
+ return "videodb://movies/genres/";
else if (dir.Equals("MovieTitles"))
- return "videodb://1/2/";
+ return "videodb://movies/titles/";
else if (dir.Equals("MovieYears"))
- return "videodb://1/3/";
+ return "videodb://movies/years/";
else if (dir.Equals("MovieActors"))
- return "videodb://1/4/";
+ return "videodb://movies/actors/";
else if (dir.Equals("MovieDirectors"))
- return "videodb://1/5/";
+ return "videodb://movies/directors/";
else if (dir.Equals("MovieStudios"))
- return "videodb://1/6/";
+ return "videodb://movies/studios/";
else if (dir.Equals("MovieSets"))
- return "videodb://1/7/";
+ return "videodb://movies/sets/";
else if (dir.Equals("MovieCountries"))
- return "videodb://1/8/";
+ return "videodb://movies/countries/";
else if (dir.Equals("MovieTags"))
- return "videodb://1/9/";
+ return "videodb://movies/tags/";
else if (dir.Equals("Movies"))
- return "videodb://1/";
+ return "videodb://movies/";
else if (dir.Equals("TvShowGenres"))
- return "videodb://2/1/";
+ return "videodb://tvshows/genres/";
else if (dir.Equals("TvShowTitles"))
- return "videodb://2/2/";
+ return "videodb://tvshows/titles/";
else if (dir.Equals("TvShowYears"))
- return "videodb://2/3/";
+ return "videodb://tvshows/years/";
else if (dir.Equals("TvShowActors"))
- return "videodb://2/4/";
+ return "videodb://tvshows/actors/";
else if (dir.Equals("TvShowStudios"))
- return "videodb://2/5/";
+ return "videodb://tvshows/studios/";
else if (dir.Equals("TvShowTags"))
- return "videodb://2/9/";
+ return "videodb://tvshows/tags/";
else if (dir.Equals("TvShows"))
- return "videodb://2/";
+ return "videodb://tvshows/";
else if (dir.Equals("MusicVideoGenres"))
- return "videodb://3/1/";
+ return "videodb://musicvideos/genres/";
else if (dir.Equals("MusicVideoTitles"))
- return "videodb://3/2/";
+ return "videodb://musicvideos/titles/";
else if (dir.Equals("MusicVideoYears"))
- return "videodb://3/3/";
+ return "videodb://musicvideos/years/";
else if (dir.Equals("MusicVideoArtists"))
- return "videodb://3/4/";
+ return "videodb://musicvideos/artist/";
else if (dir.Equals("MusicVideoAlbums"))
- return "videodb://3/5/";
+ return "videodb://musicvideos/albums/";
else if (dir.Equals("MusicVideoDirectors"))
- return "videodb://3/6/";
+ return "videodb://musicvideos/directors/";
else if (dir.Equals("MusicVideoStudios"))
- return "videodb://3/7/";
+ return "videodb://musicvideos/studios/";
else if (dir.Equals("MusicVideoTags"))
- return "videodb://3/9/";
+ return "videodb://musicvideos/tags/";
else if (dir.Equals("MusicVideos"))
- return "videodb://3/";
+ return "videodb://musicvideos/";
else if (dir.Equals("RecentlyAddedMovies"))
- return "videodb://4/";
+ return "videodb://recentlyaddedmovies/";
else if (dir.Equals("RecentlyAddedEpisodes"))
- return "videodb://5/";
+ return "videodb://recentlyaddedepisodes/";
else if (dir.Equals("RecentlyAddedMusicVideos"))
- return "videodb://6/";
+ return "videodb://recentlyaddedmusicvideos/";
else if (dir.Equals("Files"))
return "sources://video/";
return CGUIWindowVideoBase::GetStartFolder(dir);
if (type.compare("movie") == 0)
{
mediaType = MediaTypeMovie;
- baseDir += "1";
+ baseDir += "movies";
idColumn = "idMovie";
}
else if (type.compare("tvshow") == 0)
{
mediaType = MediaTypeTvShow;
- baseDir += "2";
+ baseDir += "tvshows";
idColumn = "idShow";
}
else if (type.compare("musicvideo") == 0)
{
mediaType = MediaTypeMusicVideo;
- baseDir += "3";
+ baseDir += "musicvideos";
idColumn = "idMVideo";
}
- baseDir += "/2/";
+ baseDir += "/titles/";
CVideoDbUrl videoUrl;
if (!videoUrl.FromString(baseDir))
return false;
CStdString strHeading; strHeading.Format(g_localizeStrings.Get(20457));
CStdString baseDir;
- baseDir.Format("videodb://1/7/%d", setItem->GetVideoInfoTag()->m_iDbId);
+ baseDir.Format("videodb://movies/sets/%d", setItem->GetVideoInfoTag()->m_iDbId);
if (!CDirectory::GetDirectory(baseDir, originalMovies) || originalMovies.Size() <= 0) // keep a copy of the original members of the set
return false;
CFileItemList listItems;
- if (!videodb.GetSortedVideos(MediaTypeMovie, "videodb://1", SortDescription(), listItems) || listItems.Size() <= 0)
+ if (!videodb.GetSortedVideos(MediaTypeMovie, "videodb://movies", SortDescription(), listItems) || listItems.Size() <= 0)
return false;
CGUIDialogSelect *dialog = (CGUIDialogSelect *)g_windowManager.GetWindow(WINDOW_DIALOG_SELECT);
return false;
CFileItemList listItems;
- CStdString baseDir = "videodb://1/7/";
+ CStdString baseDir = "videodb://movies/sets/";
if (!CDirectory::GetDirectory(baseDir, listItems) || listItems.Size() <= 0)
return false;
listItems.Sort(SORT_METHOD_LABEL_IGNORE_THE, SortOrderAscending);