Code Monkey home page Code Monkey logo

Comments (2)

ZeroQI avatar ZeroQI commented on May 19, 2024

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:[email protected]?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) )

from hama.bundle.

EndOfLine369 avatar EndOfLine369 commented on May 19, 2024

Perfect 😄

from hama.bundle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.