Skip to content

Commit

Permalink
re-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
coder-alpha committed Apr 8, 2019
1 parent 90bee7e commit 2bfb3cc
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
6 changes: 4 additions & 2 deletions Contents/Code/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
FMOVIES_SERVER_REMAP = {'Server F':'Google-F', 'Server G':'Google-G', 'F5 Beta':'PrettyFast', 'F5 - HQ':'PrettyFast'}
FMOVIES_HOSTS_DISABLED = ['MyCloud','PrettyFast']

MISC_OPTIONS_KEYS = ['SOURCE_SEARCH_TIMEOUT','SMART_ADD_EP_FALLOUT_DAYS','SMART_ADD_SEASON_FALLOUT_DAYS','Extend-Smart-Add-For-Seasons','Retry-Failed-Downloads','Dont-Refresh-Library-Downloads','Retrieve-And-Display-Partial-Sources','FMOVIES_HOSTS_UNPLAYABLE','SHOW_PLEX_SERVICE_LINKS']
MISC_OPTIONS_KEYS = ['SOURCE_SEARCH_TIMEOUT','SMART_ADD_EP_FALLOUT_DAYS','SMART_ADD_SEASON_FALLOUT_DAYS','Extend-Smart-Add-For-Seasons','Retry-Failed-Downloads','Dont-Refresh-Library-Downloads','Retrieve-And-Display-Partial-Sources','FMOVIES_HOSTS_UNPLAYABLE','SHOW_PLEX_SERVICE_LINKS','SHOW_EXTRAS']
MISC_OPTIONS_CONST = {
MISC_OPTIONS_KEYS[0]:{'type':'num','title':'AutoPilot Source Search Timeout','val':600, 'unit':'sec', 'desc':'AutoPilot Source Timeout seconds (%s-%s): %s','LL':300,'UL':300*4},
MISC_OPTIONS_KEYS[1]:{'type':'num','title':'AutoPilot Smart Add (Episode) Entry','val':30,'unit':'day', 'desc':'AutoPilot Smart Add (Episode) Entry retain days (%s-%s): %s','LL':15,'UL':15*6},
Expand All @@ -168,7 +168,8 @@
MISC_OPTIONS_KEYS[5]:{'type':'bool','title':'Don\'t perform a Library Section Refresh after an Item is Downloaded','val':False,'unit':'', 'desc':'Don\'t perform a Library Section Refresh after an Item is Downloaded: %s','LL':0,'UL':0},
MISC_OPTIONS_KEYS[6]:{'type':'bool','title':'Retrieve And Display Partial Sources','val':False,'unit':'', 'desc':'Retrieve And Display Partial Sources while Provider is processing All Sources: %s','LL':0,'UL':0},
MISC_OPTIONS_KEYS[7]:{'type':'bool','title':'Show Unplayable Hosts for FMovies site','val':False,'unit':'', 'desc':'Show Unplayable Hosts for FMovies site in item listing %s: %s' % (FMOVIES_HOSTS_DISABLED, '%s'),'LL':0,'UL':0},
MISC_OPTIONS_KEYS[8]:{'type':'bool','title':'Show Plex Service Links','val':False,'unit':'', 'desc':'Show Plex Service Links: %s','LL':0,'UL':0}
MISC_OPTIONS_KEYS[8]:{'type':'bool','title':'Show Plex Service Links','val':False,'unit':'', 'desc':'Show Plex Service Links: %s','LL':0,'UL':0},
MISC_OPTIONS_KEYS[9]:{'type':'bool','title':'Show Extras','val':True,'unit':'', 'desc':'Show Extras (Trailer, etc.): %s','LL':0,'UL':0}
}
MISC_OPTIONS = MISC_OPTIONS_CONST.copy()

Expand Down Expand Up @@ -265,6 +266,7 @@
USE_DOWNLOAD_RESUME_GEN = True
USE_DOWNLOAD_RESUME_MEGA = True
USE_EXT_URLSERVICES = True
USE_EXTRAS = True
USE_COOKIES = True
DOWNLOAD_BACKUP_OPER = True
USE_SECOND_REQUEST = True
Expand Down
28 changes: 15 additions & 13 deletions Contents/Code/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4561,6 +4561,21 @@ def ExtSources(title, url, summary, thumb, art, rating, duration, genre, directo
Log(gen_play)
Log(e)

if common.USE_EXTRAS == True and common.MISC_OPTIONS[common.MISC_OPTIONS_KEYS[9]]['val'] == True:
for source in extras_playback_links:
extExtrasSources_urlservice.append(source)

extExtrasSources_urlservice = common.OrderBasedOn(extExtrasSources_urlservice, use_host=False, use_filesize=common.UsingOption(key=common.DEVICE_OPTIONS[9], session=session))
cx = len(extExtrasSources_urlservice)

if cx > 0:
ext_summmary = ', '.join('%s (%s)' % (x['label'],'enabled' if str(x['enabled']).lower()=='true' else 'disabled') for x in common.INTERNAL_SOURCES_FILETYPE if 'Movie/Show' not in x['label'])
ocp = DirectoryObject(title = 'Extras (%s items)' % str(cx), key = Callback(PSExtSources, con_title='Extras (%s items)' % str(cx), extSources_play=E(JSON.StringFromObject(extExtrasSources_urlservice)), session=session, watch_title=watch_title, year=year, summary=summary, thumb=thumb, art=art, url=url, duration=duration, rating=rating, genre=genre, mode_trailer=True), summary=ext_summmary,thumb=R(common.ICON_PLEX))
if prog < 100:
oc.insert(1,ocp)
else:
oc.insert(0,ocp)

if common.USE_EXT_URLSERVICES == True and common.MISC_OPTIONS[common.MISC_OPTIONS_KEYS[8]]['val'] == True:
external_extSources = extSourKey

Expand All @@ -4575,12 +4590,6 @@ def ExtSources(title, url, summary, thumb, art, rating, duration, genre, directo
break
if bool == True:
extSources_urlservice.append(source)

for source in extras_playback_links:
extExtrasSources_urlservice.append(source)

extExtrasSources_urlservice = common.OrderBasedOn(extExtrasSources_urlservice, use_host=False, use_filesize=common.UsingOption(key=common.DEVICE_OPTIONS[9], session=session))
cx = len(extExtrasSources_urlservice)

for source in plexservice_playback_links:
extSources_urlservice.append(source)
Expand All @@ -4599,13 +4608,6 @@ def ExtSources(title, url, summary, thumb, art, rating, duration, genre, directo
if common.DEV_DEBUG == True and Prefs["use_debug"] == True:
Log(extSources_urlservice)

if cx > 0:
ext_summmary = ', '.join('%s (%s)' % (x['label'],'enabled' if str(x['enabled']).lower()=='true' else 'disabled') for x in common.INTERNAL_SOURCES_FILETYPE if 'Movie/Show' not in x['label'])
ocp = DirectoryObject(title = 'Extras (%s items)' % str(cx), key = Callback(PSExtSources, con_title='Extras (%s items)' % str(cx), extSources_play=E(JSON.StringFromObject(extExtrasSources_urlservice)), session=session, watch_title=watch_title, year=year, summary=summary, thumb=thumb, art=art, url=url, duration=duration, rating=rating, genre=genre, mode_trailer=True), summary=ext_summmary,thumb=R(common.ICON_PLEX))
if prog < 100:
oc.insert(1,ocp)
else:
oc.insert(0,ocp)
if c > 0:
ocp = DirectoryObject(title = 'External Sources (via Plex-Service) %s links' % str(c), key = Callback(PSExtSources, con_title='External Sources (via Plex-Service) %s links' % str(c), extSources_play=E(JSON.StringFromObject(extSources_urlservice)), session=session, watch_title=watch_title, year=year, summary=summary, thumb=thumb, art=art, url=url, duration=duration, rating=rating, genre=genre), summary='Playable via Plex services that are available and a Generic Player that tries its best to handle the rest.', thumb=R(common.ICON_PLEX))
oc.append(ocp)
Expand Down

0 comments on commit 2bfb3cc

Please sign in to comment.