Release Version 0.9.8
add folder display settings add random musly list folder add incoming / incoming hits folder small (mostly whitespace) fixes
This commit is contained in:
parent
664517d2d3
commit
4ba6096b9b
6 changed files with 120 additions and 27 deletions
78
default.py
78
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':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue