diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a845616b..9214eff5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -124,6 +124,6 @@ github: stage: release script: - apk add git - - git remote set-url origin "https://$GITHUB_USER:$GITHUB_TOKEN@github.com/$CI_PROJECT_PATH".git" + - git remote set-url origin "https://$GITHUB_USER:$GITHUB_TOKEN@github.com/$CI_PROJECT_PATH.git" - git tag $TAG - git push --tags \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 4db6a942..72b73207 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,16 @@ # Change Log -## [v1.7.4](https://github.com/Boerderij/Varken/tree/v1.7.4) (2019-10-07) -[Full Changelog](https://github.com/Boerderij/Varken/compare/1.7.3...v1.7.4) +## [v1.7.5](https://github.com/Boerderij/Varken/tree/v1.7.5) (2019-12-11) +[Full Changelog](https://github.com/Boerderij/Varken/compare/1.7.4...v1.7.5) + +**Merged pull requests:** + +- v1.7.5 Merge [\#162](https://github.com/Boerderij/Varken/pull/162) ([DirtyCajunRice](https://github.com/DirtyCajunRice)) +- Add helper itemgetter function for TautulliStream fields [\#157](https://github.com/Boerderij/Varken/pull/157) ([JonnyWong16](https://github.com/JonnyWong16)) +- Fix to only use NamedTuple fields from TautulliStream [\#156](https://github.com/Boerderij/Varken/pull/156) ([JonnyWong16](https://github.com/JonnyWong16)) + +## [1.7.4](https://github.com/Boerderij/Varken/tree/1.7.4) (2019-10-07) +[Full Changelog](https://github.com/Boerderij/Varken/compare/1.7.3...1.7.4) **Implemented enhancements:** @@ -24,6 +33,10 @@ - \[BUG\] Varken Crashes when ini is read only [\#146](https://github.com/Boerderij/Varken/issues/146) - \[BUG\] Missing Available Movies/TV Shows does not take Monitored status into account [\#141](https://github.com/Boerderij/Varken/issues/141) +**Closed issues:** + +- \[Feature Request\] Medusa Support [\#148](https://github.com/Boerderij/Varken/issues/148) + **Merged pull requests:** - v1.7.3 Merge [\#149](https://github.com/Boerderij/Varken/pull/149) ([DirtyCajunRice](https://github.com/DirtyCajunRice)) @@ -323,4 +336,4 @@ - Create crontabs [\#6](https://github.com/Boerderij/Varken/pull/6) ([ghost](https://github.com/ghost)) - update plex\_dashboard.json [\#5](https://github.com/Boerderij/Varken/pull/5) ([ghost](https://github.com/ghost)) - Update README.md [\#4](https://github.com/Boerderij/Varken/pull/4) ([ghost](https://github.com/ghost)) -- added sickrage portion [\#3](https://github.com/Boerderij/Varken/pull/3) ([ghost](https://github.com/ghost)) +- added sickrage portion [\#3](https://github.com/Boerderij/Varken/pull/3) ([ghost](https://github.com/ghost)) \ No newline at end of file diff --git a/varken/__init__.py b/varken/__init__.py index 72b3f7d1..a4c7ccef 100644 --- a/varken/__init__.py +++ b/varken/__init__.py @@ -1,2 +1,2 @@ -VERSION = "1.7.4" +VERSION = "1.7.5" BRANCH = 'master' diff --git a/varken/helpers.py b/varken/helpers.py index 65b886b1..77090c18 100644 --- a/varken/helpers.py +++ b/varken/helpers.py @@ -203,3 +203,7 @@ def boolcheck(var): return True else: return False + + +def itemgetter_with_default(**defaults): + return lambda obj: tuple(obj.get(k, v) for k, v in defaults.items()) diff --git a/varken/tautulli.py b/varken/tautulli.py index c0d11a29..c0ec8e55 100644 --- a/varken/tautulli.py +++ b/varken/tautulli.py @@ -5,7 +5,7 @@ from influxdb.exceptions import InfluxDBClientError from varken.structures import TautulliStream -from varken.helpers import hashit, connection_handler +from varken.helpers import hashit, connection_handler, itemgetter_with_default class TautulliAPI(object): @@ -34,14 +34,10 @@ def get_activity(self): return get = g['response']['data'] - - # Remove erroneous key from sessions - for session in get['sessions']: - if session.get('_cache_time'): - del session['_cache_time'] + fields = itemgetter_with_default(**TautulliStream._field_defaults) try: - sessions = [TautulliStream(**session) for session in get['sessions']] + sessions = [TautulliStream(*fields(session)) for session in get['sessions']] except TypeError as e: self.logger.error('TypeError has occurred : %s while creating TautulliStream structure', e) return