Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Download Themes from PLEX" option not being used #69

Closed
EndOfLine369 opened this issue Jul 27, 2016 · 2 comments
Closed

"Download Themes from PLEX" option not being used #69

EndOfLine369 opened this issue Jul 27, 2016 · 2 comments
Assignees
Labels

Comments

@EndOfLine369
Copy link
Collaborator

Looks like the "Download Themes from PLEX" option is not being used in the code. It will always try to pull themes.
@ZeroQI, are you aware of why this is?

image

image

image

ZeroQI added a commit that referenced this issue Jul 27, 2016
#69
dissapeared when i externalised "metadata_download" function apparently
@ZeroQI
Copy link
Owner

ZeroQI commented Jul 27, 2016

it was present some time ago when code looked like this:
created a download function, but apparently skipped Prefs

      ### Plex - Plex Theme song - https://plexapp.zendesk.com/hc/en-us/articles/201178657-Current-TV-Themes ###
      # if in current folder, or the parent one /  url = local / elif  in common theme song folder / try language priority / try root of common theme song folder / try remote server
      #if filename in metadata.themes:  Log.Debug("parseAniDBXml - Theme song - already added from local copy")
      url = THEME_URL % tvdbid
      if    url in metadata.themes:  Log.Debug("parseAniDBXml - Theme song - already added")
      else:
        filename = "Plex/%s.mp3" % metadata.id
        if Data.Exists(filename):
          Log.Debug("parseAniDBXml - Theme song - not added but present locally: adding it from local file")
          theme_song = Data.Load(filename)
          metadata.themes[filename] = Proxy.Media(theme_song)
        elif Prefs['GetPlexThemes']:
          if self.http_status_code(THEME_URL % tvdbid) == 200:
            try:                  theme_song = HTTP.Request(url, cacheTime=None)
            except Exception, e:  Log.Debug("parseAniDBXml - Theme song - not added previously and not present locally but on Plex servers, however download failed: %s" % url)
            else:
              Log.Debug("parseAniDBXml - Theme song - not added previously and not present locally but on Plex servers, and download suceeded: %s" % url)
              try:     Data.Save(filename, theme_song)
              except:  Log.Debug("parseAniDBXml - Plugin Data Folder not created, no local cache")
              metadata.themes[url] = Proxy.Media(theme_song)
          else:
            Log.Debug("parseAniDBXml - Theme song - Theme song not present on Plex servers for tvdbid: %s" % tvdbid)
            try:     tvdb_title = getElementText(tvdbanime, '/Data/Series/SeriesName')
            except:
              tvdb_title= "title error, Not in serie XML"
              error_log ['anime-list tvdbid missing'].append("anidbid: %s, title: '%s', tvdbid: %s, Not in serie XML, %s" % (metadata.id.zfill(5), orig, tvdbid.zfill(5), WEB_LINK % (TVDB_SERIE_URL % tvdbid, "TVDB") ) )
            error_log   ['Plex themes missing'      ].append("anidbid: %s, title: '%s', tvdbid: %s, title: '%s' <a href='mailto:themes@plexapp.com?cc=&subject=Missing%%20theme%%20song%%20-%%20&#39;%s%%20-%%20%s.mp3&#39;'>Upload</a>" % (metadata.id.zfill(5), orig, tvdbid.zfill(5), tvdb_title, tvdb_title, tvdbid) )

@ZeroQI ZeroQI closed this as completed Jul 27, 2016
@EndOfLine369
Copy link
Collaborator Author

Perfect 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants