Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: pkkid/python-plexapi
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 4.15.8
Choose a base ref
...
head repository: pkkid/python-plexapi
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 4.15.9
Choose a head ref
  • 4 commits
  • 5 files changed
  • 1 contributor

Commits on Feb 5, 2024

  1. Copy the full SHA
    36cbcd0 View commit details
  2. Add convenience method to return filter choice items (#1353)

    * Add convenience method to return filter choice items
    
    * Add test for filter choice items
    JonnyWong16 authored Feb 5, 2024
    Copy the full SHA
    a85291e View commit details
  3. Copy the full SHA
    e161ce6 View commit details
  4. Release 4.15.9

    JonnyWong16 committed Feb 5, 2024
    Copy the full SHA
    b51aa19 View commit details
Showing with 13 additions and 3 deletions.
  1. +4 −1 plexapi/client.py
  2. +1 −1 plexapi/const.py
  3. +4 −0 plexapi/library.py
  4. +1 −1 tests/test_gdm.py
  5. +3 −0 tests/test_library.py
5 changes: 4 additions & 1 deletion plexapi/client.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
import time
import weakref
from xml.etree import ElementTree

import requests
@@ -62,7 +63,8 @@ class PlexClient(PlexObject):
key = '/resources'

def __init__(self, server=None, data=None, initpath=None, baseurl=None,
identifier=None, token=None, connect=True, session=None, timeout=None):
identifier=None, token=None, connect=True, session=None, timeout=None,
parent=None):
super(PlexClient, self).__init__(server, data, initpath)
self._baseurl = baseurl.strip('/') if baseurl else None
self._clientIdentifier = identifier
@@ -76,6 +78,7 @@ def __init__(self, server=None, data=None, initpath=None, baseurl=None,
self._last_call = 0
self._timeline_cache = []
self._timeline_cache_timestamp = 0
self._parent = weakref.ref(parent) if parent is not None else None
if not any([data is not None, initpath, baseurl, token]):
self._baseurl = CONFIG.get('auth.client_baseurl', 'http://localhost:32433')
self._token = logfilter.add_secret(CONFIG.get('auth.client_token'))
2 changes: 1 addition & 1 deletion plexapi/const.py
Original file line number Diff line number Diff line change
@@ -4,6 +4,6 @@
# Library version
MAJOR_VERSION = 4
MINOR_VERSION = 15
PATCH_VERSION = 8
PATCH_VERSION = 9
__short_version__ = f"{MAJOR_VERSION}.{MINOR_VERSION}"
__version__ = f"{__short_version__}.{PATCH_VERSION}"
4 changes: 4 additions & 0 deletions plexapi/library.py
Original file line number Diff line number Diff line change
@@ -2949,6 +2949,10 @@ def _loadData(self, data):
self.title = data.attrib.get('title')
self.type = data.attrib.get('type')

def items(self):
""" Returns a list of items for this filter choice. """
return self.fetchItems(self.fastKey)


class ManagedHub(PlexObject):
""" Represents a Managed Hub (recommendation) inside a library.
2 changes: 1 addition & 1 deletion tests/test_gdm.py
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ def test_gdm(plex):

gdm_enabled = plex.settings.get("GdmEnabled")

gdm.scan(timeout=2)
gdm.scan()
if gdm_enabled:
assert len(gdm.entries)
else:
3 changes: 3 additions & 0 deletions tests/test_library.py
Original file line number Diff line number Diff line change
@@ -551,6 +551,9 @@ def test_library_MovieSection_search_FilterChoice(movies, collection):
movie = collection.items()[0]
assert movie in results

items = filterChoice.items()
assert movie in items


def test_library_MovieSection_advancedSearch(movies, movie):
advancedFilters = {