music update
parent
a25e598a4b
commit
f9226315b7
30
Core.py
30
Core.py
|
@ -1259,14 +1259,12 @@ class Core:
|
|||
for title in dirList:
|
||||
self.drawItem(title, 'openTorrent', url, isFolder=True, action2=title)
|
||||
|
||||
ids_video = ''
|
||||
for title, identifier in contentListNew:
|
||||
try:
|
||||
ext = title.split('.')[-1]
|
||||
if re.match('avi|mp4|mkV|flv|mov|vob|wmv|ogm|asx|mpg|mpeg|avc|vp3|fli|flc|m4v', ext, re.I):
|
||||
ids_video = ids_video + str(identifier) + ','
|
||||
except:
|
||||
pass
|
||||
ids_video_result = get_ids_video(contentListNew)
|
||||
ids_video=''
|
||||
|
||||
if len(ids_video_result)>0:
|
||||
for identifier in ids_video_result:
|
||||
ids_video = ids_video + str(identifier) + ','
|
||||
|
||||
for title, identifier in contentListNew:
|
||||
contextMenu = [
|
||||
|
@ -1421,7 +1419,7 @@ class Core:
|
|||
contentList = sorted(contentList, key=lambda x: x[0])
|
||||
for title, identifier in contentList:
|
||||
try:
|
||||
if title.split('.')[-1].lower() in ['avi','mp4','mkv','flv','mov','vob','wmv','ogm','asx','mpg','mpeg','avc','vp3','fli','flc','m4v','iso']:
|
||||
if title.split('.')[-1].lower() in ['avi','mp4','mkv','flv','mov','vob','wmv','ogm','asx','mpg','mpeg','avc','vp3','fli','flc','m4v','iso','mp3']:
|
||||
myshows_items.append(title)
|
||||
myshows_files.append(identifier)
|
||||
except:
|
||||
|
@ -1458,14 +1456,12 @@ class Core:
|
|||
for title in dirList:
|
||||
self.drawItem(title, 'openTorrent', url, image=thumbnail, isFolder=True, action2=title)
|
||||
|
||||
ids_video = ''
|
||||
for title, identifier in contentListNew:
|
||||
try:
|
||||
ext = title.split('.')[-1]
|
||||
if ext.lower() in ['avi','mp4','mkv','flv','mov','vob','wmv','ogm','asx','mpg','mpeg','avc','vp3','fli','flc','m4v','iso']:
|
||||
ids_video = ids_video + str(identifier) + ','
|
||||
except:
|
||||
pass
|
||||
ids_video_result = get_ids_video(contentListNew)
|
||||
ids_video=''
|
||||
|
||||
if len(ids_video_result)>0:
|
||||
for identifier in ids_video_result:
|
||||
ids_video = ids_video + str(identifier) + ','
|
||||
|
||||
for title, identifier in contentListNew:
|
||||
contextMenu = [
|
||||
|
|
21
Player.py
21
Player.py
|
@ -11,7 +11,7 @@ import Downloader
|
|||
import xbmcgui
|
||||
import xbmcvfs
|
||||
import Localization
|
||||
from functions import calculate, showMessage, clearStorage, DownloadDB, cutFolder
|
||||
from functions import calculate, showMessage, clearStorage, DownloadDB, get_ids_video
|
||||
|
||||
|
||||
ROOT = sys.modules["__main__"].__root__
|
||||
|
@ -403,24 +403,7 @@ class TorrentPlayer(xbmc.Player):
|
|||
|
||||
def get_ids(self):
|
||||
contentList = []
|
||||
#path=self.torrent.getContentList()[self.contentId]['title']
|
||||
#print path
|
||||
for filedict in self.torrent.getContentList():
|
||||
contentList.append((filedict.get('title'), str(filedict.get('ind'))))
|
||||
contentList = sorted(contentList, key=lambda x: x[0])
|
||||
#print str(contentList)
|
||||
|
||||
#dirList, contentListNew = cutFolder(contentList)
|
||||
|
||||
ids_video = []
|
||||
#print str(contentListNew)
|
||||
for title, identifier in contentList:
|
||||
try:
|
||||
ext = title.split('.')[-1]
|
||||
if ext.lower() in ['avi','mp4','mkv','flv','mov','vob','wmv','ogm','asx','mpg','mpeg','avc','vp3','fli','flc','m4v','iso']:
|
||||
ids_video.append(str(identifier))
|
||||
except:
|
||||
pass
|
||||
|
||||
#print 'get_ids:'+str(ids_video)
|
||||
return ids_video
|
||||
return get_ids_video(contentList)
|
19
functions.py
19
functions.py
|
@ -1576,4 +1576,21 @@ def itemScrap(item, kwarg):
|
|||
if 'info' in kwarg and kwarg['properties']:
|
||||
item.setInfo(type='Video', infoLabels=kwarg['info'])
|
||||
|
||||
return item
|
||||
return item
|
||||
|
||||
def get_ids_video(contentList):
|
||||
ids_video=[]
|
||||
allowed_video_ext=['avi','mp4','mkv','flv','mov','vob','wmv','ogm','asx','mpg','mpeg','avc','vp3','fli','flc','m4v','iso']
|
||||
allowed_music_ext=['mp3','flac','wma','ogg','m4a','aac','m4p','rm','ra']
|
||||
for extlist in [allowed_video_ext,allowed_music_ext]:
|
||||
for title, identifier in contentList:
|
||||
try:
|
||||
ext = title.split('.')[-1]
|
||||
if ext.lower() in extlist:
|
||||
ids_video.append(str(identifier))
|
||||
except:
|
||||
pass
|
||||
if len(ids_video)>1:
|
||||
break
|
||||
#print Debug('[get_ids_video]:'+str(ids_video))
|
||||
return ids_video
|
||||
|
|
Loading…
Reference in New Issue