Skip to content

Commit

Permalink
Make "Recent ..." menu items independent of the respective main items
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman Miroshnychenko committed Dec 4, 2023
1 parent 56ebd4f commit 6616fbe
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 31 deletions.
38 changes: 19 additions & 19 deletions plugin.video.external.library/libs/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,40 +60,40 @@ def root():
"""Root action"""
xbmcplugin.setPluginCategory(HANDLE,
_('Kodi Medialibrary on {kodi_host}').format(
kodi_host=ADDON.getSetting('kodi_host')))
kodi_host=ADDON.getSettingString('kodi_host')))
if ADDON.getSettingBool('show_movies'):
list_item = ListItem(f'[{_("Movies")}]')
list_item.setArt({'icon': 'DefaultMovies.png', 'thumb': 'DefaultMovies.png'})
url = get_plugin_url(content_type='movies')
xbmcplugin.addDirectoryItem(HANDLE, url, list_item, isFolder=True)
if ADDON.getSettingBool('show_recent_movies'):
list_item = ListItem(f'[{_("Recently added movies")}]')
list_item.setArt({'icon': 'DefaultRecentlyAddedMovies.png',
'thumb': 'DefaultRecentlyAddedMovies.png'})
url = get_plugin_url(content_type='recent_movies')
xbmcplugin.addDirectoryItem(HANDLE, url, list_item, isFolder=True)
if ADDON.getSettingBool('show_recent_movies'):
list_item = ListItem(f'[{_("Recently added movies")}]')
list_item.setArt({'icon': 'DefaultRecentlyAddedMovies.png',
'thumb': 'DefaultRecentlyAddedMovies.png'})
url = get_plugin_url(content_type='recent_movies')
xbmcplugin.addDirectoryItem(HANDLE, url, list_item, isFolder=True)
if ADDON.getSettingBool('show_tvshows'):
list_item = ListItem(f'[{_("TV Shows")}]')
list_item.setArt({'icon': 'DefaultTVShows.png', 'thumb': 'DefaultTVShows.png'})
url = get_plugin_url(content_type='tvshows')
xbmcplugin.addDirectoryItem(HANDLE, url, list_item, isFolder=True)
if ADDON.getSettingBool('show_recent_episodes'):
list_item = ListItem(f'[{_("Recently added episodes")}]')
list_item.setArt({'icon': 'DefaultRecentlyAddedEpisodes.png',
'thumb': 'DefaultRecentlyAddedEpisodes.png'})
url = get_plugin_url(content_type='recent_episodes')
xbmcplugin.addDirectoryItem(HANDLE, url, list_item, isFolder=True)
if ADDON.getSettingBool('show_recent_episodes'):
list_item = ListItem(f'[{_("Recently added episodes")}]')
list_item.setArt({'icon': 'DefaultRecentlyAddedEpisodes.png',
'thumb': 'DefaultRecentlyAddedEpisodes.png'})
url = get_plugin_url(content_type='recent_episodes')
xbmcplugin.addDirectoryItem(HANDLE, url, list_item, isFolder=True)
if ADDON.getSettingBool('show_music_videos'):
list_item = ListItem(f'[{_("Music videos")}]')
list_item.setArt({'icon': 'DefaultMusicVideos.png', 'thumb': 'DefaultMusicVideos.png'})
url = get_plugin_url(content_type='music_videos')
xbmcplugin.addDirectoryItem(HANDLE, url, list_item, isFolder=True)
if ADDON.getSettingBool('show_recent_music_videos'):
list_item = ListItem(f'[{_("Recently added music videos")}]')
list_item.setArt({'icon': 'DefaultRecentlyAddedMusicVideos.png',
'thumb': 'DefaultRecentlyAddedMusicVideos.png'})
url = get_plugin_url(content_type='recent_music_videos')
xbmcplugin.addDirectoryItem(HANDLE, url, list_item, isFolder=True)
if ADDON.getSettingBool('show_recent_music_videos'):
list_item = ListItem(f'[{_("Recently added music videos")}]')
list_item.setArt({'icon': 'DefaultRecentlyAddedMusicVideos.png',
'thumb': 'DefaultRecentlyAddedMusicVideos.png'})
url = get_plugin_url(content_type='recent_music_videos')
xbmcplugin.addDirectoryItem(HANDLE, url, list_item, isFolder=True)


def show_media_items(content_type, tvshowid=None, season=None, parent_category=None):
Expand Down
12 changes: 0 additions & 12 deletions plugin.video.external.library/resources/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@
<level>0</level>
<default>true</default>
<control type="toggle"/>
<dependencies>
<dependency type="visible" setting="show_movies">true</dependency>
</dependencies>
</setting>
<setting id="show_tvshows" type="boolean" label="32005" help="">
<level>0</level>
Expand All @@ -67,9 +64,6 @@
<level>0</level>
<default>true</default>
<control type="toggle"/>
<dependencies>
<dependency type="visible" setting="show_tvshows">true</dependency>
</dependencies>
</setting>
<setting id="flatten_seasons" type="integer" label="32009" help="">
<level>0</level>
Expand All @@ -82,9 +76,6 @@
</options>
</constraints>
<control type="spinner" format="string"/>
<dependencies>
<dependency type="visible" setting="show_tvshows">true</dependency>
</dependencies>
</setting>
<setting id="show_music_videos" type="boolean" label="32027" help="">
<level>0</level>
Expand All @@ -95,9 +86,6 @@
<level>0</level>
<default>true</default>
<control type="toggle"/>
<dependencies>
<dependency type="visible" setting="show_music_videos">true</dependency>
</dependencies>
</setting>
</group>
</category>
Expand Down

0 comments on commit 6616fbe

Please sign in to comment.