コード例 #1
0
ファイル: server.py プロジェクト: myakove/python-plexapi
 def library(self):
     """ Library to browse or search your media. """
     if not self._library:
         try:
             data = self.query(Library.key)
             self._library = Library(self, data)
         except BadRequest:
             # Only the owner has access to /library
             # so just return the library without the data.
             return Library(self, {})
     return self._library
コード例 #2
0
ファイル: app.py プロジェクト: virenparmar12/Plex-API
def createFolder():
    request_data = request.get_json()
    lib_type = request_data['type']
    lib_name = request_data['name']

    b = Library(server=plex, data=None)
    if lib_type == "movie":
        b.add(
            name=f"{lib_name}",
            type=f"{lib_type}",
            agent="com.plexapp.agents.none",
            scanner=
            "Plex Movie, Plex Movie Scanner, Plex Video Files Scanner, Plex Video Files",
            location="/Movies",
            language="en",
            enableCinemaTrailers=True,
            enableBIFGeneration=True,
            includeInGlobal=True)
        return "library created successfully"
    if lib_type == "photo":
        b.add(name=f"{lib_name}",
              type=f"{lib_type}",
              agent="com.plexapp.agents.none",
              scanner="Plex Photo Scanner",
              location="/Photos",
              language="en",
              enableAutoPhotoTags=True,
              enableBIFGeneration=True,
              includeInGlobal=True)
        return "library created successfully"
    if lib_type == "show":
        b.add(name=f"{lib_name}",
              type=f"{lib_type}",
              agent="com.plexapp.agents.none",
              scanner="Plex TV Series,Plex Series Scanner",
              location="/Shows",
              language="en",
              episodeSort=1,
              flattenSeasons=0,
              enableBIFGeneration=True,
              includeInGlobal=True)
        return "library created successfully"
    else:
        return "please give a valid type of library"
コード例 #3
0
ファイル: server.py プロジェクト: sprt/python-plexapi
 def library(self):
     return Library(self, self.query('/library/'))
コード例 #4
0
 def library(self):
     """ Library to browse or search your media. """
     if not self._library:
         data = self.query(Library.key)
         self._library = Library(self, data)
     return self._library
コード例 #5
0
ファイル: server.py プロジェクト: suavp/python-plexapi
 def library(self):
     if not self._library:
         self._library = Library(self, self.query('/library/'))
     return self._library
コード例 #6
0
ファイル: server.py プロジェクト: zombieagain/plexapi
 def library(self):
     """Library to browse or search your media."""
     if not self._library:
         self._library = Library(self, self.query('/library/'))
     return self._library