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
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"
def library(self): return Library(self, self.query('/library/'))
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
def library(self): if not self._library: self._library = Library(self, self.query('/library/')) return self._library
def library(self): """Library to browse or search your media.""" if not self._library: self._library = Library(self, self.query('/library/')) return self._library