Merge pull request #2182 from Montellese/xsp_grouping
authorSascha Montellese <sascha.montellese@gmail.com>
Mon, 8 Apr 2013 21:35:43 +0000 (14:35 -0700)
committerSascha Montellese <sascha.montellese@gmail.com>
Mon, 8 Apr 2013 21:35:43 +0000 (14:35 -0700)
smartplaylists: add support for grouping

103 files changed:
addons/skin.confluence/720p/SmartPlaylistEditor.xml
language/English/strings.po
project/VS2010Express/XBMC.vcxproj
project/VS2010Express/XBMC.vcxproj.filters
system/library/video/movies/actors.xml
system/library/video/movies/country.xml
system/library/video/movies/directors.xml
system/library/video/movies/genres.xml
system/library/video/movies/sets.xml
system/library/video/movies/studios.xml
system/library/video/movies/tags.xml
system/library/video/movies/titles.xml
system/library/video/movies/years.xml
system/library/video/musicvideos/albums.xml
system/library/video/musicvideos/artists.xml
system/library/video/musicvideos/directors.xml
system/library/video/musicvideos/genres.xml
system/library/video/musicvideos/studios.xml
system/library/video/musicvideos/tags.xml
system/library/video/musicvideos/titles.xml
system/library/video/musicvideos/years.xml
system/library/video/recentlyaddedepisodes.xml
system/library/video/recentlyaddedmovies.xml
system/library/video/recentlyaddedmusicvideos.xml
system/library/video/tvshows/actors.xml
system/library/video/tvshows/genres.xml
system/library/video/tvshows/studios.xml
system/library/video/tvshows/tags.xml
system/library/video/tvshows/titles.xml
system/library/video/tvshows/years.xml
system/library/video_flat/movies.xml
system/library/video_flat/musicvideos.xml
system/library/video_flat/recentlyaddedepisodes.xml
system/library/video_flat/recentlyaddedmovies.xml
system/library/video_flat/recentlyaddedmusicvideos.xml
system/library/video_flat/tvshows.xml
xbmc/PartyModeManager.cpp
xbmc/dialogs/GUIDialogSmartPlaylistEditor.cpp
xbmc/dialogs/GUIDialogSmartPlaylistEditor.h
xbmc/dialogs/GUIDialogSmartPlaylistRule.cpp
xbmc/filesystem/MusicDatabaseDirectory/DirectoryNode.cpp
xbmc/filesystem/MusicDatabaseDirectory/DirectoryNode.h
xbmc/filesystem/MusicDatabaseDirectory/DirectoryNodeGenre.cpp [deleted file]
xbmc/filesystem/MusicDatabaseDirectory/DirectoryNodeGenre.h [deleted file]
xbmc/filesystem/MusicDatabaseDirectory/DirectoryNodeGrouped.cpp [new file with mode: 0644]
xbmc/filesystem/MusicDatabaseDirectory/DirectoryNodeGrouped.h [new file with mode: 0644]
xbmc/filesystem/MusicDatabaseDirectory/DirectoryNodeOverview.cpp
xbmc/filesystem/MusicDatabaseDirectory/DirectoryNodeTop100.cpp
xbmc/filesystem/MusicDatabaseDirectory/DirectoryNodeYear.cpp [deleted file]
xbmc/filesystem/MusicDatabaseDirectory/DirectoryNodeYear.h [deleted file]
xbmc/filesystem/MusicDatabaseDirectory/Makefile
xbmc/filesystem/SmartPlaylistDirectory.cpp
xbmc/filesystem/VideoDatabaseDirectory.cpp
xbmc/filesystem/VideoDatabaseDirectory/DirectoryNode.cpp
xbmc/filesystem/VideoDatabaseDirectory/DirectoryNode.h
xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeActor.cpp [deleted file]
xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeActor.h [deleted file]
xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeCountry.cpp [deleted file]
xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeCountry.h [deleted file]
xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeDirector.cpp [deleted file]
xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeDirector.h [deleted file]
xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeGenre.cpp [deleted file]
xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeGenre.h [deleted file]
xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeGrouped.cpp [new file with mode: 0644]
xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeGrouped.h [new file with mode: 0644]
xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeMoviesOverview.cpp
xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeMusicVideoAlbum.cpp [deleted file]
xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeMusicVideoAlbum.h [deleted file]
xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeMusicVideosOverview.cpp
xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeOverview.cpp
xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeSets.cpp [deleted file]
xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeSets.h [deleted file]
xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeStudio.cpp [deleted file]
xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeStudio.h [deleted file]
xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeTags.cpp [deleted file]
xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeTags.h [deleted file]
xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeTvShowsOverview.cpp
xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeYear.cpp [deleted file]
xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeYear.h [deleted file]
xbmc/filesystem/VideoDatabaseDirectory/Makefile
xbmc/filesystem/VideoDatabaseDirectory/QueryParams.cpp
xbmc/interfaces/json-rpc/AudioLibrary.cpp
xbmc/interfaces/json-rpc/VideoLibrary.cpp
xbmc/music/GUIViewStateMusic.cpp
xbmc/music/MusicDatabase.cpp
xbmc/music/MusicDatabase.h
xbmc/music/dialogs/GUIDialogSongInfo.cpp
xbmc/music/infoscanner/MusicInfoScanner.cpp
xbmc/music/windows/GUIWindowMusicBase.cpp
xbmc/music/windows/GUIWindowMusicNav.cpp
xbmc/network/upnp/UPnPInternal.cpp
xbmc/network/upnp/UPnPServer.cpp
xbmc/playlists/SmartPlayList.cpp
xbmc/playlists/SmartPlayList.h
xbmc/utils/DatabaseUtils.h
xbmc/utils/EdenVideoArtUpdater.cpp
xbmc/utils/GroupUtils.cpp
xbmc/utils/RecentlyAddedJob.cpp
xbmc/video/VideoDatabase.cpp
xbmc/video/VideoDatabase.h
xbmc/video/dialogs/GUIDialogVideoInfo.cpp
xbmc/video/windows/GUIWindowVideoBase.cpp
xbmc/video/windows/GUIWindowVideoNav.cpp

index cae4be9..06a7cbe 100644 (file)
@@ -4,7 +4,7 @@
        <coordinates>
                <system>1</system>
                <posx>240</posx>
-               <posy>45</posy>
+               <posy>22</posy>
        </coordinates>
        <include>dialogeffect</include>
        <controls>
@@ -16,7 +16,7 @@
                                <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>
index 8ccd55d..a571e4d 100644 (file)
@@ -9283,7 +9283,10 @@ msgctxt "#20417"
 msgid "Writer"
 msgstr ""
 
-#empty string with id 20418
+#: xbmc/playlists/SmartPlayList.cpp
+msgctxt "#20418"
+msgid "Writers"
+msgstr ""
 
 #: xbmc/settings/GUISettings.cpp
 msgctxt "#20419"
@@ -9943,7 +9946,13 @@ msgctxt "#21457"
 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"
index a4afefc..3afa612 100644 (file)
     <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" />
index fb50a4d..4be787c 100644 (file)
     <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">
index 348ef6f..811b294 100644 (file)
@@ -1,7 +1,8 @@
 <?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>
 
index 3d0a753..d1c6995 100644 (file)
@@ -1,6 +1,7 @@
 <?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>
index 2f248a2..68a0d34 100644 (file)
@@ -1,6 +1,7 @@
 <?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>
index 198806b..f3fdf26 100644 (file)
@@ -1,6 +1,7 @@
 <?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>
index 3363e8c..f87790e 100644 (file)
@@ -1,6 +1,7 @@
 <?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>
index bdc44b4..462fb95 100644 (file)
@@ -1,6 +1,7 @@
 <?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>
index 762bb8a..53c3ae4 100644 (file)
@@ -1,6 +1,7 @@
 <?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>
index d93ddda..53e7044 100644 (file)
@@ -1,6 +1,7 @@
 <?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>
index 69db6ae..4f2f1d5 100644 (file)
@@ -1,7 +1,8 @@
 <?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>
 
index 9b2e717..e72aa39 100644 (file)
@@ -1,6 +1,7 @@
 <?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>
index 92ae8a5..34da167 100644 (file)
@@ -1,6 +1,7 @@
 <?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>
index 4971290..d532635 100644 (file)
@@ -1,6 +1,7 @@
 <?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>
index 4c060a6..751703a 100644 (file)
@@ -1,6 +1,7 @@
 <?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>
index cfb64f8..d63ff7d 100644 (file)
@@ -1,6 +1,7 @@
 <?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>
index a1297b6..0b96db6 100644 (file)
@@ -1,6 +1,7 @@
 <?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>
index 79f73b2..4bea08a 100644 (file)
@@ -1,6 +1,7 @@
 <?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>
index f05e99f..4586495 100644 (file)
@@ -1,6 +1,7 @@
 <?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>
index ba968b4..caf1357 100644 (file)
@@ -2,5 +2,5 @@
 <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>
index 3b7e660..1363d4b 100644 (file)
@@ -2,5 +2,5 @@
 <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>
index a91e9eb..e8b886e 100644 (file)
@@ -2,5 +2,5 @@
 <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>
index 2abfb20..761e81f 100644 (file)
@@ -1,6 +1,7 @@
 <?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>
index 1d6fdb2..69b4dcd 100644 (file)
@@ -1,6 +1,7 @@
 <?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>
index 582e24d..0362dbf 100644 (file)
@@ -1,6 +1,7 @@
 <?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>
index f959299..4682aea 100644 (file)
@@ -1,6 +1,7 @@
 <?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>
index 58d9f90..8f32d21 100644 (file)
@@ -1,6 +1,7 @@
 <?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>
index 17c4579..ae4a745 100644 (file)
@@ -1,6 +1,7 @@
 <?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>
index 39bbb46..13f2904 100644 (file)
@@ -1,6 +1,7 @@
 <?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>
index 93052a2..5922b81 100644 (file)
@@ -1,6 +1,7 @@
 <?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>
index ba968b4..caf1357 100644 (file)
@@ -2,5 +2,5 @@
 <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>
index 3b7e660..1363d4b 100644 (file)
@@ -2,5 +2,5 @@
 <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>
index a91e9eb..e8b886e 100644 (file)
@@ -2,5 +2,5 @@
 <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>
index 37d1487..5f19e4d 100644 (file)
@@ -1,6 +1,7 @@
 <?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>
index 56ff460..306007b 100644 (file)
@@ -620,14 +620,14 @@ bool CPartyModeManager::AddInitialSongs(vector<pair<int,int> > &songIDs)
       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;
index 3afb882..451be19 100644 (file)
@@ -43,6 +43,8 @@ using namespace std;
 #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
@@ -118,6 +120,10 @@ bool CGUIDialogSmartPlaylistEditor::OnMessage(CGUIMessage& message)
         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;
@@ -241,6 +247,24 @@ void CGUIDialogSmartPlaylistEditor::OnOrderDirection()
   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)
@@ -304,6 +328,43 @@ void CGUIDialogSmartPlaylistEditor::UpdateButtons()
     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()
@@ -353,7 +414,6 @@ void CGUIDialogSmartPlaylistEditor::OnWindowLoaded()
 void CGUIDialogSmartPlaylistEditor::OnInitWindow()
 {
   m_cancelled = false;
-  UpdateButtons();
 
   SendMessage(GUI_MSG_ITEM_SELECT, CONTROL_LIMIT, m_playlist.m_limit);
 
@@ -401,6 +461,7 @@ void CGUIDialogSmartPlaylistEditor::OnInitWindow()
 
   SendMessage(GUI_MSG_ITEM_SELECT, CONTROL_TYPE, type);
   m_playlist.SetType(ConvertType(type));
+  UpdateButtons();
 
   CGUIDialog::OnInitWindow();
 }
index 98fa3ef..66fd1d7 100644 (file)
@@ -51,6 +51,8 @@ protected:
   void OnType();
   void OnOrder();
   void OnOrderDirection();
+  void OnGroupBy();
+  void OnGroupMixed();
   void OnOK();
   void OnCancel();
   void UpdateButtons();
index 9d606ec..e10d502 100644 (file)
@@ -110,16 +110,16 @@ void CGUIDialogSmartPlaylistRule::OnBrowse()
 
   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"))
   {
@@ -128,20 +128,20 @@ void CGUIDialogSmartPlaylistRule::OnBrowse()
       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;
@@ -154,7 +154,7 @@ void CGUIDialogSmartPlaylistRule::OnBrowse()
   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;
@@ -166,7 +166,7 @@ void CGUIDialogSmartPlaylistRule::OnBrowse()
   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;
@@ -177,36 +177,29 @@ void CGUIDialogSmartPlaylistRule::OnBrowse()
   }
   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)
@@ -217,24 +210,24 @@ void CGUIDialogSmartPlaylistRule::OnBrowse()
   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++)
@@ -243,7 +236,7 @@ void CGUIDialogSmartPlaylistRule::OnBrowse()
     }
     else if (m_type.Equals("musicvideos"))
     {
-      videodatabase.GetMusicVideosNav(basePath + "2/", items);
+      videodatabase.GetMusicVideosNav(basePath + "titles/", items);
       iLabel = 20389;
     }
     else
@@ -293,7 +286,7 @@ void CGUIDialogSmartPlaylistRule::OnBrowse()
   }
   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)
@@ -306,7 +299,7 @@ void CGUIDialogSmartPlaylistRule::OnBrowse()
     else if (m_type != "movies")
       return;
 
-    videodatabase.GetTagsNav(basePath + "9/", items, type);
+    videodatabase.GetTagsNav(basePath + "tags/", items, type);
     iLabel = 20459;
   }
   else
index 0f5b83a..c731fe8 100644 (file)
@@ -23,7 +23,7 @@
 #include "QueryParams.h"
 #include "DirectoryNodeRoot.h"
 #include "DirectoryNodeOverview.h"
-#include "DirectoryNodeGenre.h"
+#include "DirectoryNodeGrouped.h"
 #include "DirectoryNodeArtist.h"
 #include "DirectoryNodeAlbum.h"
 #include "DirectoryNodeSong.h"
@@ -37,7 +37,6 @@
 #include "DirectoryNodeAlbumTop100Song.h"
 #include "DirectoryNodeAlbumCompilations.h"
 #include "DirectoryNodeAlbumCompilationsSongs.h"
-#include "DirectoryNodeYear.h"
 #include "DirectoryNodeYearAlbum.h"
 #include "DirectoryNodeYearSong.h"
 #include "DirectoryNodeSingles.h"
@@ -116,7 +115,8 @@ CDirectoryNode* CDirectoryNode::CreateNode(NODE_TYPE Type, const CStdString& str
   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:
@@ -145,8 +145,6 @@ CDirectoryNode* CDirectoryNode::CreateNode(NODE_TYPE Type, const CStdString& str
     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:
index 2fc7d21..6020f24 100644 (file)
@@ -56,9 +56,9 @@ namespace XFILE
     } NODE_TYPE;
 
     typedef struct {
-      NODE_TYPE node;
-      int       id;
-      int       label;
+      NODE_TYPE   node;
+      std::string id;
+      int         label;
     } Node;
 
     class CDirectoryNode
diff --git a/xbmc/filesystem/MusicDatabaseDirectory/DirectoryNodeGenre.cpp b/xbmc/filesystem/MusicDatabaseDirectory/DirectoryNodeGenre.cpp
deleted file mode 100644 (file)
index db6cc2a..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- *      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;
-}
diff --git a/xbmc/filesystem/MusicDatabaseDirectory/DirectoryNodeGenre.h b/xbmc/filesystem/MusicDatabaseDirectory/DirectoryNodeGenre.h
deleted file mode 100644 (file)
index a1a3ba1..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-#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;
-    };
-  }
-}
-
-
diff --git a/xbmc/filesystem/MusicDatabaseDirectory/DirectoryNodeGrouped.cpp b/xbmc/filesystem/MusicDatabaseDirectory/DirectoryNodeGrouped.cpp
new file mode 100644 (file)
index 0000000..981407c
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+ *      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 "";
+}
diff --git a/xbmc/filesystem/MusicDatabaseDirectory/DirectoryNodeGrouped.h b/xbmc/filesystem/MusicDatabaseDirectory/DirectoryNodeGrouped.h
new file mode 100644 (file)
index 0000000..177b9ca
--- /dev/null
@@ -0,0 +1,43 @@
+#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;
+    };
+  }
+}
+
+
index fdfbebd..40042ed 100644 (file)
@@ -28,16 +28,16 @@ namespace XFILE
   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 },
                               };
   };
 };
@@ -54,7 +54,7 @@ CDirectoryNodeOverview::CDirectoryNodeOverview(const CStdString& strName, CDirec
 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;
 }
@@ -62,7 +62,7 @@ NODE_TYPE CDirectoryNodeOverview::GetChildType() const
 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 "";
 }
@@ -87,7 +87,7 @@ bool CDirectoryNodeOverview::GetContent(CFileItemList& items) const
 
     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);
index 5c9cacd..5a3c837 100644 (file)
@@ -26,8 +26,8 @@ using namespace std;
 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)
@@ -39,7 +39,7 @@ CDirectoryNodeTop100::CDirectoryNodeTop100(const CStdString& strName, CDirectory
 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;
@@ -48,7 +48,7 @@ NODE_TYPE CDirectoryNodeTop100::GetChildType() const
 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 "";
 }
@@ -59,7 +59,7 @@ bool CDirectoryNodeTop100::GetContent(CFileItemList& items) const
   {
     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);
diff --git a/xbmc/filesystem/MusicDatabaseDirectory/DirectoryNodeYear.cpp b/xbmc/filesystem/MusicDatabaseDirectory/DirectoryNodeYear.cpp
deleted file mode 100644 (file)
index 260ae25..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- *      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;
-}
diff --git a/xbmc/filesystem/MusicDatabaseDirectory/DirectoryNodeYear.h b/xbmc/filesystem/MusicDatabaseDirectory/DirectoryNodeYear.h
deleted file mode 100644 (file)
index d046309..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-#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;
-    };
-  }
-}
-
-
index 1a1221a..98d9253 100644 (file)
@@ -9,14 +9,13 @@ SRCS=DirectoryNode.cpp \
      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 \
index ba0847e..83f0bed 100644 (file)
 #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
 {
@@ -71,6 +74,8 @@ 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") ||
@@ -86,18 +91,27 @@ namespace XFILE
         {
           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;
@@ -118,93 +132,68 @@ namespace XFILE
           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;
         }
 
@@ -214,12 +203,13 @@ namespace XFILE
           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;
@@ -229,8 +219,20 @@ namespace XFILE
         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
@@ -247,8 +249,12 @@ namespace XFILE
           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())
@@ -261,9 +267,24 @@ namespace XFILE
         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++)
index d007281..8e4da79 100644 (file)
@@ -227,7 +227,7 @@ CStdString CVideoDatabaseDirectory::GetIcon(const CStdString &strDirectory)
   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";
@@ -235,7 +235,7 @@ CStdString CVideoDatabaseDirectory::GetIcon(const CStdString &strDirectory)
     }
     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";
@@ -243,7 +243,7 @@ CStdString CVideoDatabaseDirectory::GetIcon(const CStdString &strDirectory)
     }
     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";
index f3bccc3..1c90d07 100644 (file)
 #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"
@@ -121,19 +113,15 @@ CDirectoryNode* CDirectoryNode::CreateNode(NODE_TYPE Type, const CStdString& str
   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:
@@ -150,16 +138,12 @@ CDirectoryNode* CDirectoryNode::CreateNode(NODE_TYPE Type, const CStdString& str
     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;
   }
index 3bdf1bb..e63d1b7 100644 (file)
@@ -58,9 +58,9 @@ namespace XFILE
     } NODE_TYPE;
 
     typedef struct {
-      NODE_TYPE node;
-      int       id;
-      int       label;
+      NODE_TYPE   node;
+      std::string id;
+      int         label;
     } Node;
     
     class CDirectoryNode
diff --git a/xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeActor.cpp b/xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeActor.cpp
deleted file mode 100644 (file)
index 69ebd4f..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- *      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;
-}
-
diff --git a/xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeActor.h b/xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeActor.h
deleted file mode 100644 (file)
index 4deb783..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-#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;
-    };
-  }
-}
-
-
diff --git a/xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeCountry.cpp b/xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeCountry.cpp
deleted file mode 100644 (file)
index 83571f7..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- *      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;
-}
diff --git a/xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeCountry.h b/xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeCountry.h
deleted file mode 100644 (file)
index 6393dd2..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-#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;
-    };
-  }
-}
-
-
diff --git a/xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeDirector.cpp b/xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeDirector.cpp
deleted file mode 100644 (file)
index b98ae6f..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- *      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;
-}
-
diff --git a/xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeDirector.h b/xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeDirector.h
deleted file mode 100644 (file)
index 34ea7fb..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-#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;
-    };
-  }
-}
-
-
diff --git a/xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeGenre.cpp b/xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeGenre.cpp
deleted file mode 100644 (file)
index e9e2600..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- *      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;
-}
diff --git a/xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeGenre.h b/xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeGenre.h
deleted file mode 100644 (file)
index 7440a74..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-#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;
-    };
-  }
-}
-
-
diff --git a/xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeGrouped.cpp b/xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeGrouped.cpp
new file mode 100644 (file)
index 0000000..d7639f4
--- /dev/null
@@ -0,0 +1,127 @@
+/*
+ *      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 &params) 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 "";
+}
diff --git a/xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeGrouped.h b/xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeGrouped.h
new file mode 100644 (file)
index 0000000..b672960
--- /dev/null
@@ -0,0 +1,44 @@
+#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 &params) const;
+    };
+  }
+}
+
+
index befc83f..520efe6 100644 (file)
@@ -28,15 +28,15 @@ using namespace XFILE::VIDEODATABASEDIRECTORY;
 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)
@@ -48,7 +48,7 @@ CDirectoryNodeMoviesOverview::CDirectoryNodeMoviesOverview(const CStdString& str
 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;
@@ -57,7 +57,7 @@ NODE_TYPE CDirectoryNodeMoviesOverview::GetChildType() const
 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 "";
 }
@@ -78,7 +78,7 @@ bool CDirectoryNodeMoviesOverview::GetContent(CFileItemList& items) const
     }
 
     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));
diff --git a/xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeMusicVideoAlbum.cpp b/xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeMusicVideoAlbum.cpp
deleted file mode 100644 (file)
index 6eee909..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- *      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;
-}
-
diff --git a/xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeMusicVideoAlbum.h b/xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeMusicVideoAlbum.h
deleted file mode 100644 (file)
index 8958012..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-#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;
-    };
-  }
-}
-
-
index 321dc0b..31bda34 100644 (file)
 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)
@@ -45,7 +45,7 @@ CDirectoryNodeMusicVideosOverview::CDirectoryNodeMusicVideosOverview(const CStdS
 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;
@@ -54,7 +54,7 @@ NODE_TYPE CDirectoryNodeMusicVideosOverview::GetChildType() const
 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 "";
 }
@@ -70,7 +70,7 @@ bool CDirectoryNodeMusicVideosOverview::GetContent(CFileItemList& items) const
     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());
 
index dedba42..ecdedc9 100644 (file)
@@ -30,12 +30,12 @@ using namespace std;
 
 
 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)
@@ -47,7 +47,7 @@ CDirectoryNodeOverview::CDirectoryNodeOverview(const CStdString& strName, CDirec
 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;
@@ -56,7 +56,7 @@ NODE_TYPE CDirectoryNodeOverview::GetChildType() const
 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 "";
 }
@@ -72,31 +72,31 @@ bool CDirectoryNodeOverview::GetContent(CFileItemList& items) const
   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)
diff --git a/xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeSets.cpp b/xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeSets.cpp
deleted file mode 100644 (file)
index 40cd805..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- *      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;
-}
diff --git a/xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeSets.h b/xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeSets.h
deleted file mode 100644 (file)
index 130ddca..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-#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;
-    };
-  }
-}
-
-
diff --git a/xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeStudio.cpp b/xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeStudio.cpp
deleted file mode 100644 (file)
index 14791d1..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- *      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;
-}
diff --git a/xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeStudio.h b/xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeStudio.h
deleted file mode 100644 (file)
index 53319df..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-#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;
-    };
-  }
-}
-
-
diff --git a/xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeTags.cpp b/xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeTags.cpp
deleted file mode 100644 (file)
index e38c3b8..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- *      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;
-}
diff --git a/xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeTags.h b/xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeTags.h
deleted file mode 100644 (file)
index 3b374ef..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-#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;
-    };
-  }
-}
-
-
index 7b5ba32..064d08d 100644 (file)
 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)
@@ -46,7 +46,7 @@ NODE_TYPE CDirectoryNodeTvShowsOverview::GetChildType() const
     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;
@@ -55,7 +55,7 @@ NODE_TYPE CDirectoryNodeTvShowsOverview::GetChildType() const
 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 "";
 }
@@ -71,7 +71,7 @@ bool CDirectoryNodeTvShowsOverview::GetContent(CFileItemList& items) const
     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());
 
diff --git a/xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeYear.cpp b/xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeYear.cpp
deleted file mode 100644 (file)
index 17443b1..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- *      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;
-}
diff --git a/xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeYear.h b/xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeYear.h
deleted file mode 100644 (file)
index 4af1ab5..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-#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;
-    };
-  }
-}
-
-
index bda9117..de882d6 100644 (file)
@@ -1,11 +1,7 @@
 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 \
@@ -13,14 +9,10 @@ SRCS=DirectoryNode.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
index 101aaca..ea0327d 100644 (file)
@@ -19,6 +19,7 @@
  */
 
 #include "QueryParams.h"
+#include "video/VideoDatabase.h"
 
 using namespace XFILE::VIDEODATABASEDIRECTORY;
 
@@ -48,7 +49,12 @@ void CQueryParams::SetQueryParam(NODE_TYPE NodeType, const CStdString& strNodeNa
   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;
index 708e234..9f91cc2 100644 (file)
@@ -45,7 +45,7 @@ JSONRPC_STATUS CAudioLibrary::GetArtists(const CStdString &method, ITransportLay
     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"))
@@ -98,7 +98,7 @@ JSONRPC_STATUS CAudioLibrary::GetArtistDetails(const CStdString &method, ITransp
   int artistID = (int)parameterObject["artistid"].asInteger();
 
   CMusicDbUrl musicUrl;
-  if (!musicUrl.FromString("musicdb://2/"))
+  if (!musicUrl.FromString("musicdb://artists/"))
     return InternalError;
 
   CMusicDatabase musicdatabase;
@@ -129,7 +129,7 @@ JSONRPC_STATUS CAudioLibrary::GetAlbums(const CStdString &method, ITransportLaye
     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"))
@@ -207,7 +207,7 @@ JSONRPC_STATUS CAudioLibrary::GetSongs(const CStdString &method, ITransportLayer
     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"))
@@ -288,7 +288,7 @@ JSONRPC_STATUS CAudioLibrary::GetRecentlyAddedAlbums(const CStdString &method, I
   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);
@@ -339,7 +339,7 @@ JSONRPC_STATUS CAudioLibrary::GetRecentlyPlayedAlbums(const CStdString &method,
   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);
@@ -379,7 +379,7 @@ JSONRPC_STATUS CAudioLibrary::GetGenres(const CStdString &method, ITransportLaye
     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*/
@@ -620,7 +620,7 @@ bool CAudioLibrary::FillFileItemList(const CVariant &parameterObject, CFileItemL
   }
 
   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)
index c619edf..e6b7bc4 100644 (file)
@@ -40,7 +40,7 @@ JSONRPC_STATUS CVideoLibrary::GetMovies(const CStdString &method, ITransportLaye
     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"))
@@ -106,7 +106,7 @@ JSONRPC_STATUS CVideoLibrary::GetMovieSets(const CStdString &method, ITransportL
     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);
@@ -130,7 +130,7 @@ JSONRPC_STATUS CVideoLibrary::GetMovieSetDetails(const CStdString &method, ITran
 
   // 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);
@@ -148,7 +148,7 @@ JSONRPC_STATUS CVideoLibrary::GetTVShows(const CStdString &method, ITransportLay
     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"))
@@ -223,7 +223,7 @@ JSONRPC_STATUS CVideoLibrary::GetSeasons(const CStdString &method, ITransportLay
   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;
@@ -247,7 +247,7 @@ JSONRPC_STATUS CVideoLibrary::GetEpisodes(const CStdString &method, ITransportLa
   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);
@@ -306,7 +306,7 @@ JSONRPC_STATUS CVideoLibrary::GetEpisodeDetails(const CStdString &method, ITrans
   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);
@@ -325,7 +325,7 @@ JSONRPC_STATUS CVideoLibrary::GetMusicVideos(const CStdString &method, ITranspor
     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"))
@@ -381,7 +381,7 @@ JSONRPC_STATUS CVideoLibrary::GetRecentlyAddedMovies(const CStdString &method, I
     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);
@@ -394,7 +394,7 @@ JSONRPC_STATUS CVideoLibrary::GetRecentlyAddedEpisodes(const CStdString &method,
     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);
@@ -407,7 +407,7 @@ JSONRPC_STATUS CVideoLibrary::GetRecentlyAddedMusicVideos(const CStdString &meth
     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);
@@ -424,19 +424,19 @@ JSONRPC_STATUS CVideoLibrary::GetGenres(const CStdString &method, ITransportLaye
   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())
index 19dae4c..02be182 100644 (file)
@@ -600,7 +600,7 @@ VECSOURCES& CGUIViewStateWindowMusicNav::GetSources()
   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);
index 90c4f13..a13268a 100644 (file)
@@ -925,7 +925,7 @@ CSong CMusicDatabase::GetSongFromDataset(bool bWithMusicDbPath/*=false*/)
   {
     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;
@@ -1210,7 +1210,7 @@ bool CMusicDatabase::SearchArtists(const CStdString& search, CFileItemList &arti
     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());
@@ -1771,7 +1771,7 @@ bool CMusicDatabase::SearchSongs(const CStdString& search, CFileItemList &items)
     while (!m_pDS->eof())
     {
       CFileItemPtr item(new CFileItem);
-      GetFileItemFromDataset(item.get(), "musicdb://4/");
+      GetFileItemFromDataset(item.get(), "musicdb://songs/");
       items.Add(item);
       m_pDS->next();
     }
@@ -1807,7 +1807,7 @@ bool CMusicDatabase::SearchAlbums(const CStdString& search, CFileItemList &album
     {
       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);
@@ -2699,19 +2699,25 @@ bool CMusicDatabase::GetGenresNav(const CStdString& strBaseDir, CFileItemList& i
   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());
@@ -4361,27 +4367,27 @@ bool CMusicDatabase::GetScraperForPath(const CStdString& strPath, ADDON::Scraper
       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());
       }
     }
@@ -4456,6 +4462,48 @@ bool CMusicDatabase::ScraperInUse(const CStdString &scraperID) const
   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
@@ -5459,7 +5507,8 @@ bool CMusicDatabase::GetFilter(CDbUrl &musicUrl, Filter &filter, SortDescription
       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));
index e970939..d386e75 100644 (file)
@@ -154,7 +154,7 @@ public:
   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);
@@ -202,6 +202,11 @@ public:
    */
   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);
 
index cf3139d..f36b1e0 100644 (file)
@@ -111,7 +111,7 @@ bool CGUIDialogSongInfo::OnMessage(CGUIMessage& message)
         {
           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);
index 3e0fc54..91fdfa9 100644 (file)
@@ -250,7 +250,7 @@ void CMusicInfoScanner::FetchAlbumInfo(const CStdString& strDirectory,
   if (strDirectory.IsEmpty())
   {
     m_musicDatabase.Open();
-    m_musicDatabase.GetAlbumsNav("musicdb://3/", items);
+    m_musicDatabase.GetAlbumsNav("musicdb://albums/", items);
     m_musicDatabase.Close();
   }
   else
@@ -300,7 +300,7 @@ void CMusicInfoScanner::FetchArtistInfo(const CStdString& strDirectory,
   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
@@ -592,7 +592,7 @@ int CMusicInfoScanner::RetrieveMusicInfo(CFileItemList& items, const CStdString&
       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();
@@ -613,7 +613,7 @@ int CMusicInfoScanner::RetrieveMusicInfo(CFileItemList& items, const CStdString&
         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);
index 38bb827..652d306 100644 (file)
@@ -801,7 +801,7 @@ bool CGUIWindowMusicBase::FindAlbumInfo(const CStdString& strAlbum, const CStdSt
   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);
@@ -851,7 +851,7 @@ bool CGUIWindowMusicBase::FindArtistInfo(const CStdString& strArtist, CMusicArti
   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);
index 1158fd9..d334ea6 100644 (file)
@@ -212,29 +212,29 @@ bool CGUIWindowMusicNav::OnAction(const CAction& action)
 
 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";
@@ -438,8 +438,7 @@ void CGUIWindowMusicNav::GetContextButtons(int itemNumber, CContextButtons &butt
     {
       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)
@@ -565,12 +564,12 @@ bool CGUIWindowMusicNav::OnContextButton(int itemNumber, CONTEXT_BUTTON button)
         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);
@@ -582,12 +581,12 @@ bool CGUIWindowMusicNav::OnContextButton(int itemNumber, CONTEXT_BUTTON button)
       }
 
       // 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);
@@ -636,7 +635,7 @@ bool CGUIWindowMusicNav::OnContextButton(int itemNumber, CONTEXT_BUTTON button)
       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;
     }
@@ -691,14 +690,14 @@ bool CGUIWindowMusicNav::OnContextButton(int itemNumber, CONTEXT_BUTTON button)
       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;
       }
@@ -850,28 +849,28 @@ void CGUIWindowMusicNav::AddSearchFolder()
 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);
 }
index 44624e5..c2ad3d0 100644 (file)
@@ -222,7 +222,7 @@ PopulateObjectFromTag(CMusicInfoTag&         tag,
         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 = "";
@@ -256,12 +256,12 @@ PopulateObjectFromTag(CVideoInfoTag&         tag,
           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);
@@ -273,7 +273,7 @@ PopulateObjectFromTag(CVideoInfoTag&         tag,
           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);
         }
     }
 
index 6738683..e9010c1 100644 (file)
@@ -34,12 +34,12 @@ namespace UPNP
 
 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
@@ -413,20 +413,20 @@ CUPnPServer::Announce(AnnouncementFlag flag, const char *sender, const char *mes
                 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") {
@@ -436,9 +436,9 @@ CUPnPServer::Announce(AnnouncementFlag flag, const char *sender, const char *mes
             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/");
             }
         }
     }
@@ -458,13 +458,13 @@ static NPT_String TranslateWMPObjectId(NPT_String id)
         // 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);
@@ -770,7 +770,7 @@ CUPnPServer::OnSearchContainer(PLT_ActionReference&          action,
             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/";
@@ -780,14 +780,14 @@ CUPnPServer::OnSearchContainer(PLT_ActionReference&          action,
                 // 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/";
             }
@@ -809,7 +809,7 @@ CUPnPServer::OnSearchContainer(PLT_ActionReference&          action,
         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
@@ -818,7 +818,7 @@ CUPnPServer::OnSearchContainer(PLT_ActionReference&          action,
         } 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
 
@@ -826,14 +826,14 @@ CUPnPServer::OnSearchContainer(PLT_ActionReference&          action,
         } 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");
@@ -850,19 +850,19 @@ CUPnPServer::OnSearchContainer(PLT_ActionReference&          action,
 
         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");
@@ -870,12 +870,12 @@ CUPnPServer::OnSearchContainer(PLT_ActionReference&          action,
             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) {
@@ -887,15 +887,14 @@ CUPnPServer::OnSearchContainer(PLT_ActionReference&          action,
         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;
       }
index d59794e..08205e3 100644 (file)
@@ -140,6 +140,31 @@ static const operatorField operators[] = {
 
 #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;
@@ -325,6 +350,28 @@ CStdString CSmartPlaylistRule::TranslateOperator(SEARCH_OPERATOR oper)
   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++)
@@ -619,6 +666,57 @@ std::vector<SortBy> CSmartPlaylistRule::GetOrders(const CStdString &type)
   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++)
@@ -626,6 +724,28 @@ CStdString CSmartPlaylistRule::GetLocalizedOperator(SEARCH_OPERATOR oper)
   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;
@@ -1274,6 +1394,13 @@ bool CSmartPlaylist::Load(const CVariant &obj)
   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();
@@ -1315,6 +1442,14 @@ bool CSmartPlaylist::LoadFromXML(const TiXmlNode *root, const CStdString &encodi
     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);
@@ -1363,6 +1498,17 @@ bool CSmartPlaylist::Save(const CStdString &path) const
   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);
@@ -1393,6 +1539,13 @@ bool CSmartPlaylist::Save(CVariant &obj, bool full /* = true */) const
   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;
@@ -1427,6 +1580,8 @@ void CSmartPlaylist::Reset()
   m_orderField = SortByNone;
   m_orderDirection = SortOrderNone;
   m_playlistType = "songs"; // sane default
+  m_group.clear();
+  m_groupMixed = false;
 }
 
 void CSmartPlaylist::SetName(const CStdString &name)
index fdf4fca..4eb3a8f 100644 (file)
@@ -86,11 +86,17 @@ public:
   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);
 
@@ -185,6 +191,11 @@ public:
   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.
@@ -218,6 +229,8 @@ private:
   unsigned int m_limit;
   SortBy m_orderField;
   SortOrder m_orderDirection;
+  CStdString m_group;
+  bool m_groupMixed;
 
   CXBMCTinyXML m_xmlDoc;
 };
index e076c22..2127d5b 100644 (file)
@@ -35,6 +35,7 @@ namespace dbiplus
 
 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)
index d7ff690..e3cc319 100644 (file)
@@ -77,7 +77,7 @@ void CEdenVideoArtUpdater::Process()
   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];
@@ -111,7 +111,7 @@ void CEdenVideoArtUpdater::Process()
   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];
@@ -146,7 +146,7 @@ void CEdenVideoArtUpdater::Process()
 
   // 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];
@@ -198,7 +198,7 @@ void CEdenVideoArtUpdater::Process()
 
     // 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());
@@ -225,7 +225,7 @@ void CEdenVideoArtUpdater::Process()
   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];
@@ -235,7 +235,7 @@ void CEdenVideoArtUpdater::Process()
     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))
@@ -248,10 +248,10 @@ void CEdenVideoArtUpdater::Process()
   // 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];
index 1126091..3b06210 100644 (file)
@@ -76,7 +76,7 @@ bool GroupUtils::Group(GroupBy groupBy, const std::string &baseDir, const CFileI
       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);
index 8ceba27..9bae92b 100644 (file)
@@ -58,7 +58,7 @@ bool CRecentlyAddedJob::UpdateVideo()
   
   videodatabase.Open();
 
-  if (videodatabase.GetRecentlyAddedMoviesNav("videodb://4/", items, NUM_ITEMS))
+  if (videodatabase.GetRecentlyAddedMoviesNav("videodb://recentlyaddedmovies/", items, NUM_ITEMS))
   {  
     for (; i < items.Size(); ++i)
     {
@@ -101,7 +101,7 @@ bool CRecentlyAddedJob::UpdateVideo()
   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)
     {    
@@ -160,7 +160,7 @@ bool CRecentlyAddedJob::UpdateVideo()
   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)
     {
@@ -217,7 +217,7 @@ bool CRecentlyAddedJob::UpdateMusic()
   
   musicdatabase.Open();
   
-  if (musicdatabase.GetRecentlyAddedAlbumSongs("musicdb://4/", musicItems, NUM_ITEMS))
+  if (musicdatabase.GetRecentlyAddedAlbumSongs("musicdb://songs/", musicItems, NUM_ITEMS))
   {
     long idAlbum = -1;
     CStdString strAlbumThumb;
@@ -289,7 +289,7 @@ bool CRecentlyAddedJob::UpdateMusic()
       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);
index b0d1d2d..64b095f 100644 (file)
@@ -1691,7 +1691,7 @@ void CVideoDatabase::GetMoviesByActor(const CStdString& strActor, CFileItemList&
                  "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)
@@ -1703,7 +1703,7 @@ void CVideoDatabase::GetTvShowsByActor(const CStdString& strActor, CFileItemList
                  "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)
@@ -1715,7 +1715,7 @@ void CVideoDatabase::GetEpisodesByActor(const CStdString& strActor, CFileItemLis
                  "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)
@@ -1848,7 +1848,7 @@ bool CVideoDatabase::GetSetInfo(int idSet, CVideoInfoTag& details)
     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;
@@ -5020,12 +5020,11 @@ bool CVideoDatabase::GetTagsNav(const CStdString& strBaseDir, CFileItemList& ite
   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);
 }
 
@@ -5809,7 +5808,7 @@ bool CVideoDatabase::GetSeasonsNav(const CStdString& strBaseDir, CFileItemList&
       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);
@@ -5871,6 +5870,98 @@ bool CVideoDatabase::GetSortedVideos(MediaType mediaType, const CStdString& strB
   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 */,
@@ -6321,7 +6412,7 @@ bool CVideoDatabase::GetEpisodesNav(const CStdString& strBaseDir, CFileItemList&
     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);
@@ -6838,7 +6929,7 @@ void CVideoDatabase::GetMovieGenresByName(const CStdString& strSearch, CFileItem
       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();
@@ -6879,7 +6970,7 @@ void CVideoDatabase::GetMovieCountriesByName(const CStdString& strSearch, CFileI
       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();
@@ -6919,7 +7010,7 @@ void CVideoDatabase::GetTvShowGenresByName(const CStdString& strSearch, CFileIte
       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();
@@ -6959,7 +7050,7 @@ void CVideoDatabase::GetMovieActorsByName(const CStdString& strSearch, CFileItem
       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();
@@ -6999,7 +7090,7 @@ void CVideoDatabase::GetTvShowsActorsByName(const CStdString& strSearch, CFileIt
       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();
@@ -7042,7 +7133,7 @@ void CVideoDatabase::GetMusicVideoArtistsByName(const CStdString& strSearch, CFi
       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();
@@ -7082,7 +7173,7 @@ void CVideoDatabase::GetMusicVideoGenresByName(const CStdString& strSearch, CFil
       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();
@@ -7138,7 +7229,7 @@ void CVideoDatabase::GetMusicVideoAlbumsByName(const CStdString& strSearch, CFil
       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();
@@ -7327,7 +7418,7 @@ bool CVideoDatabase::GetRandomMusicVideo(CFileItem* item, int& idSong, const CSt
       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);
@@ -7415,9 +7506,9 @@ void CVideoDatabase::GetMoviesByName(const CStdString& strSearch, CFileItemList&
       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);
@@ -7457,7 +7548,7 @@ void CVideoDatabase::GetTvShowsByName(const CStdString& strSearch, CFileItemList
 
       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;
@@ -7498,7 +7589,7 @@ void CVideoDatabase::GetEpisodesByName(const CStdString& strSearch, CFileItemLis
         }
 
       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);
@@ -7517,7 +7608,7 @@ void CVideoDatabase::GetMusicVideosByName(const CStdString& strSearch, CFileItem
 // 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
@@ -7564,7 +7655,7 @@ void CVideoDatabase::GetEpisodesByPlot(const CStdString& strSearch, CFileItemLis
 //  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;
 
@@ -7589,7 +7680,7 @@ void CVideoDatabase::GetEpisodesByPlot(const CStdString& strSearch, CFileItemLis
         }
 
       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);
@@ -7629,7 +7720,7 @@ void CVideoDatabase::GetMoviesByPlot(const CStdString& strSearch, CFileItemList&
         }
 
       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;
 
@@ -7674,7 +7765,7 @@ void CVideoDatabase::GetMovieDirectorsByName(const CStdString& strSearch, CFileI
       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();
@@ -7716,7 +7807,7 @@ void CVideoDatabase::GetTvShowsDirectorsByName(const CStdString& strSearch, CFil
       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();
@@ -7758,7 +7849,7 @@ void CVideoDatabase::GetMusicVideoDirectorsByName(const CStdString& strSearch, C
       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();
@@ -8187,7 +8278,7 @@ void CVideoDatabase::DumpToDummyFiles(const CStdString &path)
 {
   // 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++)
@@ -8200,7 +8291,7 @@ void CVideoDatabase::DumpToDummyFiles(const CStdString &path)
     { // 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();
@@ -8217,7 +8308,7 @@ void CVideoDatabase::DumpToDummyFiles(const CStdString &path)
   }
   // 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++)
@@ -9126,22 +9217,22 @@ bool CVideoDatabase::GetItemsForPath(const CStdString &content, const CStdString
   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);
@@ -9557,9 +9648,10 @@ bool CVideoDatabase::GetFilter(CDbUrl &videoUrl, Filter &filter, SortDescription
 
     // 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));
index 1d141af..2681ff5 100644 (file)
@@ -585,7 +585,7 @@ public:
   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);
 
@@ -651,6 +651,12 @@ public:
   // 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);
index 538f54b..eae323e 100644 (file)
@@ -570,7 +570,7 @@ void CGUIDialogVideoInfo::Play(bool resume)
   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;
index dfdd2f1..212a3b4 100644 (file)
@@ -96,6 +96,9 @@ using namespace PVR;
 #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)
 {
@@ -1892,19 +1895,30 @@ void CGUIWindowVideoBase::GetGroupedItems(CFileItemList &items)
 {
   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);
+      }
     }
   }
 
@@ -1956,7 +1970,7 @@ void CGUIWindowVideoBase::AddToDatabase(int iItem)
   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
index 6961c7f..edc74e9 100644 (file)
@@ -202,59 +202,59 @@ bool CGUIWindowVideoNav::OnMessage(CGUIMessage& message)
 
 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";
@@ -676,8 +676,8 @@ void CGUIWindowVideoNav::OnDeleteItem(CFileItemPtr pItem)
         !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);
@@ -699,8 +699,7 @@ void CGUIWindowVideoNav::OnDeleteItem(CFileItemPtr pItem)
       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);
@@ -989,7 +988,7 @@ void CGUIWindowVideoNav::GetContextButtons(int itemNumber, CContextButtons &butt
         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);
@@ -997,7 +996,7 @@ void CGUIWindowVideoNav::GetContextButtons(int itemNumber, CContextButtons &butt
           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()))
@@ -1014,7 +1013,7 @@ void CGUIWindowVideoNav::GetContextButtons(int itemNumber, CContextButtons &butt
 
         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);
@@ -1403,7 +1402,7 @@ bool CGUIWindowVideoNav::OnContextButton(int itemNumber, CONTEXT_BUTTON button)
       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;
     }
@@ -1412,7 +1411,7 @@ bool CGUIWindowVideoNav::OnContextButton(int itemNumber, CONTEXT_BUTTON button)
       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;
     }
@@ -1520,7 +1519,7 @@ void CGUIWindowVideoNav::OnLinkMovieToTvShow(int itemnumber, bool bRemove)
   }
   else
   {
-    m_database.GetTvShowsNav("videodb://2/2",list);
+    m_database.GetTvShowsNav("videodb://tvshows/titles",list);
 
     // remove already linked shows
     vector<int> ids;
@@ -1629,63 +1628,63 @@ bool CGUIWindowVideoNav::OnClick(int iItem)
 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);
@@ -1769,23 +1768,23 @@ bool CGUIWindowVideoNav::GetItemsForTag(const CStdString &strHeading, const std:
   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;
@@ -1828,13 +1827,13 @@ bool CGUIWindowVideoNav::GetMoviesForSet(CFileItemPtr &setItem, CFileItemList &o
 
   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);
@@ -1879,7 +1878,7 @@ bool CGUIWindowVideoNav::GetSetForMovie(CFileItemPtr &movieItem, CFileItemPtr &s
     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);