diff --git a/addon.xml b/addon.xml index e14c756..99a74c8 100644 --- a/addon.xml +++ b/addon.xml @@ -1,5 +1,5 @@ - + @@ -30,7 +30,12 @@ resources/img/kodi/clearlogo.png - 0.9.7 + 0.9.8 +- add folder display settings +- add random musly list folder +- add incoming / incoming hits folder +- small (mostly whitespace) fixes +0.9.7 - Vimeo Add-on is broken, play with Youtube-DL until it's fixed 0.9.6 - add display of official/unofficial count in main artist and country folders diff --git a/changelog.txt b/changelog.txt index 2c41269..78da414 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,8 @@ +0.9.8 +- add folder display settings +- add random musly list folder +- add incoming / incoming hits folder +- small (mostly whitespace) fixes 0.9.7 - Vimeo Add-on is broken, play with Youtube-DL until it's fixed 0.9.6 diff --git a/default.py b/default.py index 1e159d1..4187526 100644 --- a/default.py +++ b/default.py @@ -60,9 +60,21 @@ likecounthigh = int(addon.getSetting("likecounthigh")) dislikecounthigh = int(addon.getSetting("dislikecounthigh")) # needed for comapatibilty mode used with KODI <= 17 aka Krypton xbmcversion = int(xbmc.getInfoLabel('System.BuildVersion')[:2]) +# get folder settings +showincoming = addon.getSetting("show-incoming") +showincominghits = addon.getSetting("show-incoming-hits") +showrandom = addon.getSetting("show-random") +showsorted = addon.getSetting("show-sorted") +showstyles = addon.getSetting("show-styles") +showartists = addon.getSetting("show-artists") +showcountries = addon.getSetting("show-countries") +showsearch = addon.getSetting("show-search") +showmuslyrandom = addon.getSetting("show-musly-random") +showupdate = addon.getSetting("show-update") # play from here. Does work in general but refreshes the container which is bit contra-productive in random lists ;) -# XBMC.PlayMedia(plugin://plugin.video.vidfltr/?mode=sortTitlesBy&url=year%7crandom%7c-1,isdir) +# But it's ok in a musly-list?: +# XBMC.PlayMedia(plugin://plugin.video.vidfltr/?mode=sortTitlesBy&url=%26start%3d1555257469%26limit%3drelated%26sort%3dnone,isdir if not os.path.isdir(addon_work_folder): os.mkdir(addon_work_folder) @@ -123,13 +135,24 @@ def alphabet(): return alphabet def main(): - addDir(translation(30029), '', 'mainrandom', fanart) - addDir(translation(30012), '', 'mainsorted', fanart) - addDir(translation(30022), '&sort=all', 'styles', fanart) - addDir(translation(30005), '', 'artists', fanart) - addDir(translation(30118), '', 'countrycodes', fanart) - addDir(translation(30001), '', 'search', fanart) - addDir(translation(30006), '', 'updateData', fanart) + if showincoming == "true": + addDir(translation(30007), '&limit=all&sort=date&start=0', 'sortTitlesBy', fanart) + if showincominghits == "true": + addDir(translation(30008), '&limit=all&sort=date&start=0&hit=true', 'sortTitlesBy', fanart) + if showrandom == "true": + addDir(translation(30029), '', 'mainrandom', fanart) + if showsorted == "true": + addDir(translation(30012), '', 'mainsorted', fanart) + if showstyles == "true": + addDir(translation(30022), '&sort=all', 'styles', fanart) + if showartists == "true": + addDir(translation(30005), '', 'artists', fanart) + if showcountries == "true": + addDir(translation(30118), '', 'countrycodes', fanart) + if showsearch == "true": + addDir(translation(30001), '', 'search', fanart) + if showupdate == "true": + addDir(translation(30006), '', 'updateData', fanart) endOfDirectory() @@ -159,6 +182,8 @@ def mainrandom(): addDir(translation(30031), '&limit=all&sort=random&start=0&hit=true', 'sortTitlesBy', fanart) addDir(translation(30117), '&sort=random', 'numbers', fanart) addDir(translation(30022), '&sort=random', 'styles', fanart) + if showmuslyrandom == "true": + addDir(translation(30024), '&limit=related&start=0&sort=none', 'sortTitlesBy', fanart) endOfDirectory() def mainsorted(): @@ -244,7 +269,7 @@ def play(url): # without youtube_dl xbmc.log(msg="without ytdl", level=xbmc.LOGDEBUG) playback_url = entry['url'] - + # default mode: play from provider -- either with ytdl or vimeo/youtube/dailymotion addon else: xbmc.log(msg="play from provider", level=xbmc.LOGDEBUG) @@ -262,7 +287,7 @@ def play(url): idVideo = entry['purl'] ytdl = YDStreamExtractor.getVideoInfo(idVideo) playback_url = ytdl.streamURL() - else: + else: # without youtube_dl xbmc.log(msg="without ytdl", level=xbmc.LOGDEBUG) playback_url = entry['url'] @@ -287,6 +312,7 @@ def play(url): xbmc.log(msg=playback_url, level=xbmc.LOGNOTICE) xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, item) + def styles(): data = getVideos() channels = [] @@ -560,7 +586,8 @@ def sortTitlesBy(limit, sort, start): fanart = getFanart(channel) # limit selection if "all" isn't activated in videoselection - if videoselection != "2" and channel != "related" and channel != "relartists": + #if videoselection != "2" and channel != "related" and channel != "relartists": + if videoselection != "2": data = limitselection(data) # limit to hits @@ -641,7 +668,17 @@ def sortTitlesBy(limit, sort, start): result.append(entry) # related tracks (generated with musly) elif channel != "" and channel == "related": - start = str(start) + # random musly list + if start == 0: + # pick a random item from the already limited list (based on videoselection setting) + entry = random.choice(data) + start = str(entry['slug']) + else: + start = str(start) + # now we have to add the unlimited video list + # It will be limited later, again, if the videoselection + # setting should also be honoured in related lists + data = getVideos() for entry in data: if entry['slug'] == start: slugs = [] @@ -670,7 +707,8 @@ def sortTitlesBy(limit, sort, start): for entry in data: if entry['slug'] == start: result.insert(0, entry) - if relatedselection != "true": + # limit selection? + if videoselection != "2" and relatedselection != "true": result = limitselection(result) maximum = len(result) @@ -691,7 +729,8 @@ def sortTitlesBy(limit, sort, start): if entry['artists'] in artists: result.append(entry) xbmc.log(msg=str(results), level=xbmc.LOGNOTICE) - if relatedselection != "true": + # limit selection? + if videoselection != "2" and relatedselection != "true": result = limitselection(result) start = 0 @@ -877,7 +916,7 @@ def getFanart(channel): return fanart def limitselection(data): - xbmc.log(msg="limit by videoselection", level=xbmc.DEBUG) + xbmc.log(msg="limit by videoselection", level=xbmc.LOGDEBUG) result = [] for entry in data: if videoselection == "0": @@ -924,8 +963,8 @@ def addDir(name, url, mode, iconimage, total=0): def addVideo(entry, mycount="playcount"): ok = True -# initiaize the global video playlist. The item will be added later -# playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO) +# initialize the global video playlist. The item will be added later +# playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO) # Altlast. Sinn dahinter? if len(entry) > 7: @@ -1007,6 +1046,7 @@ hit = urllib.unquote_plus(extraparams.get('hit', '')).decode('utf-8') mycount = urllib.unquote_plus(extraparams.get('count', '')).decode('utf-8') slug = urllib.unquote_plus(extraparams.get('slug', '')).decode('utf-8') + #xbmc.log(msg=str(sys.argv), level=xbmc.LOGNOTICE) #xbmc.log(msg=str(mode), level=xbmc.LOGNOTICE) #xbmc.log(msg=str(url), level=xbmc.LOGNOTICE) @@ -1047,10 +1087,6 @@ elif mode == 'artists': artists() elif mode == 'styles': styles() -elif mode == 'stylesrandom': - stylesrandom() -elif mode == 'channelsrandom': - channelsrandom(url) elif mode == 'related': related(limit) elif mode == 'play': diff --git a/resources/language/resource.language.de_de/strings.po b/resources/language/resource.language.de_de/strings.po index cace538..be0308c 100644 --- a/resources/language/resource.language.de_de/strings.po +++ b/resources/language/resource.language.de_de/strings.po @@ -36,6 +36,14 @@ msgctxt "#30006" msgid "Refresh Data" msgstr "Daten aktualisieren" +msgctxt "#30007" +msgid "Incoming" +msgstr "Neueste" + +msgctxt "#30008" +msgid "Incoming Hits" +msgstr "Neueste Hits" + msgctxt "#30011" msgid "Random" msgstr "Zufällig" @@ -84,6 +92,10 @@ msgctxt "#30022" msgid "Genre" msgstr "Genre" +msgctxt "#30024" +msgid "Random Musly Playlist" +msgstr "Zufällige Musly Liste" + msgctxt "#30025" msgid "Artists" msgstr "Künstler" @@ -229,8 +241,8 @@ msgid "Show in title that video is unofficial" msgstr "Im Titel anzeigen das Video inoffiziell ist" msgctxt "#30121" -msgid "Similar music" -msgstr "Ähnliche Musik" +msgid "Similar music (Musly)" +msgstr "Ähnliche Musik (Musly)" msgctxt "#30122" msgid "More from..." @@ -243,3 +255,7 @@ msgstr "Zeige alle Videos in Similar- und "Mehr von"-Playlisten" msgctxt "#30124" msgid "unknown" msgstr "unbekannt" + +msgctxt "#30125" +msgid "Folder" +msgstr "Verzeichnisse" diff --git a/resources/language/resource.language.en_gb/strings.po b/resources/language/resource.language.en_gb/strings.po index a3e8630..50e9b15 100644 --- a/resources/language/resource.language.en_gb/strings.po +++ b/resources/language/resource.language.en_gb/strings.po @@ -36,6 +36,14 @@ msgctxt "#30006" msgid "Refresh Data" msgstr "" +msgctxt "#30007" +msgid "Incoming" +msgstr "" + +msgctxt "#30008" +msgid "Incoming Hits" +msgstr "" + msgctxt "#30011" msgid "Random" msgstr "" @@ -84,6 +92,10 @@ msgctxt "#30022" msgid "Genre" msgstr "" +msgctxt "#30024" +msgid "Random Musly Playlist" +msgstr "" + msgctxt "#30025" msgid "Artists" msgstr "" @@ -229,7 +241,7 @@ msgid "Show in title that video is unofficial" msgstr "" msgctxt "#30121" -msgid "Similar music" +msgid "Similar music (Musly)" msgstr "" msgctxt "#30122" @@ -243,3 +255,7 @@ msgstr "" msgctxt "#30124" msgid "unknown" msgstr "" + +msgctxt "#30125" +msgid "Folder" +msgstr "" diff --git a/resources/settings.xml b/resources/settings.xml index 022c75c..e7b593d 100644 --- a/resources/settings.xml +++ b/resources/settings.xml @@ -1,5 +1,6 @@ - + + @@ -10,6 +11,7 @@ + @@ -18,4 +20,17 @@ + + + + + + + + + + + + +