diff --git a/.travis.yml b/.travis.yml index 9860f89..83fb43c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,8 +2,10 @@ language: python jobs: include: + - python: "3.6" - python: "3.7" - python: "3.8" + - python: "3.9" - python: "nightly" allow_failures: - python: "nightly" diff --git a/Pipfile b/Pipfile index 71a0b55..2c0df8a 100644 --- a/Pipfile +++ b/Pipfile @@ -4,15 +4,14 @@ url = "https://pypi.org/simple" verify_ssl = true [dev-packages] -kodistubs = "*" +kodistubs = "~=19.0.1" pycodestyle = "*" [packages] -future = "*" -requests = "*" +requests = "~=2.22.0" [requires] -python_version = "2.7" +python_version = "3.6" [scripts] build = "python scripts/build.py" diff --git a/Pipfile.lock b/Pipfile.lock index 08c1f87..8390359 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,11 +1,11 @@ { "_meta": { "hash": { - "sha256": "91b493afc5fa48c68305d9ad93c8e9ad0eac61d669c7476cccab8dd500f9d862" + "sha256": "0b48c6d954efb0cfd4e6d3df198bd5245af751b26b918f34e9b0e865d7bcd2bd" }, "pipfile-spec": 6, "requires": { - "python_version": "2.7" + "python_version": "3.6" }, "sources": [ { @@ -18,10 +18,10 @@ "default": { "certifi": { "hashes": [ - "sha256:017c25db2a153ce562900032d5bc68e9f191e44e9a0f762f373977de9df1fbb3", - "sha256:25b64c7da4cd7479594d035c08c2d809eb4aab3a26e5a990ea98cc450c320f1f" + "sha256:1a4995114262bffbc2413b159f2a1a480c969de6e6eb13ee966d470af86af59c", + "sha256:719a74fb9e33b9bd44cc7f3a8d94bc35e4049deebe19ba7d8e108280cfd59830" ], - "version": "==2019.11.28" + "version": "==2020.12.5" }, "chardet": { "hashes": [ @@ -30,60 +30,46 @@ ], "version": "==3.0.4" }, - "future": { - "hashes": [ - "sha256:b1bead90b70cf6ec3f0710ae53a525360fa360d306a86583adc6bf83a4db537d" - ], - "index": "pypi", - "version": "==0.18.2" - }, "idna": { "hashes": [ - "sha256:7588d1c14ae4c77d74036e8c22ff447b26d0fde8f007354fd48a7814db15b7cb", - "sha256:a068a21ceac8a4d63dbfd964670474107f541babbd2250d61922f029858365fa" + "sha256:c357b3f628cf53ae2c4c05627ecc484553142ca23264e593d327bcde5e9c3407", + "sha256:ea8b7f6188e6fa117537c3df7da9fc686d485087abf6ac197f9c46432f7e4a3c" ], - "version": "==2.9" + "version": "==2.8" }, "requests": { "hashes": [ - "sha256:43999036bfa82904b6af1d99e4882b560e5e2c68e5c4b0aa03b655f3d7d73fee", - "sha256:b3f43d496c6daba4493e7c431722aeb7dbc6288f52a6e04e7b6023b0247817e6" + "sha256:11e007a8a2aa0323f5a921e9e6a2d7e4e67d9877e85773fba9ba6419025cbeb4", + "sha256:9cf5292fcd0f598c671cfc1e0d7d1a7f13bb8085e9a590f48c010551dc6c4b31" ], "index": "pypi", - "version": "==2.23.0" + "version": "==2.22.0" }, "urllib3": { "hashes": [ - "sha256:2f3db8b19923a873b3e5256dc9c2dedfa883e33d87c690d9c7913e1f40673cdc", - "sha256:87716c2d2a7121198ebcb7ce7cccf6ce5e9ba539041cfbaeecfb641dc0bf6acc" + "sha256:8d7eaa5a82a1cac232164990f04874c594c9453ec55eef02eab885aa02fc17a2", + "sha256:f5321fbe4bf3fefa0efd0bfe7fb14e90909eb62a48ccda331726b4319897dd5e" ], - "version": "==1.25.8" + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' and python_version < '4'", + "version": "==1.25.11" } }, "develop": { "kodistubs": { "hashes": [ - "sha256:a68ca61429d3d6925d108f1a0e7ec602096a3dbce5476e973ef8f81fc617ed96", - "sha256:c6e9a812f241891f9629a8921561e42041b3d62572bf8f0512f8faf4849ef64d" + "sha256:1d16b52c6278a75543d377f8a89538b0b721138f930731eb8f343c475a9f579d", + "sha256:6fdaad3e38e3e33646ab50c8813b6ffb6bdea47e199b18549b6386bb00294523" ], "index": "pypi", - "version": "==18.0.0" + "version": "==19.0.1" }, "pycodestyle": { "hashes": [ - "sha256:95a2219d12372f05704562a14ec30bc76b05a5b297b21a5dfe3f6fac3491ae56", - "sha256:e40a936c9a450ad81df37f549d676d127b1b66000a6c500caa2b085bc0ca976c" + "sha256:2295e7b2f6b5bd100585ebcb1f616591b652db8a741695b3d8f5d28bdc934367", + "sha256:c58a7d2815e0e8d7972bf1803331fb0152f867bd89adf8a01dfd55085434192e" ], "index": "pypi", - "version": "==2.5.0" - }, - "typing": { - "hashes": [ - "sha256:91dfe6f3f706ee8cc32d38edbbf304e9b7583fb37108fef38229617f8b3eba23", - "sha256:c8cabb5ab8945cd2f54917be357d134db9cc1eb039e59d1606dc1e60cb1d9d36", - "sha256:f38d83c5a7a7086543a0f649564d661859c5146a85775ab90c0d2f93ffaa9714" - ], - "version": "==3.7.4.1" + "version": "==2.6.0" } } } diff --git a/README.md b/README.md index 3fac01b..ca43fe9 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ [![Build Status](https://travis-ci.com/jaylinski/kodi-addon-soundcloud.svg?branch=master)](https://travis-ci.com/jaylinski/kodi-addon-soundcloud) [![Link to Kodi forum](https://img.shields.io/badge/Kodi-Forum-informational.svg)](https://forum.kodi.tv/showthread.php?tid=206635) [![Link to Kodi wiki](https://img.shields.io/badge/Kodi-Wiki-informational.svg)](https://kodi.wiki/view/Add-on:SoundCloud) +[![Link to Kodi releases](https://img.shields.io/badge/Kodi-v19%20%22Matrix%22-green.svg)](https://kodi.wiki/view/Releases) [![Link to Kodi releases](https://img.shields.io/badge/Kodi-v18%20%22Leia%22-green.svg)](https://kodi.wiki/view/Releases) [![Link to Kodi releases](https://img.shields.io/badge/Kodi-v17%20%22Krypton%22-green.svg)](https://kodi.wiki/view/Releases) @@ -66,8 +67,6 @@ Run `pipenv run lint`. Run `pipenv run test`. -> Requires at least Python 3.6! - ## Roadmap * Re-implement all features from original add-on diff --git a/addon.xml b/addon.xml index 43815c9..1e34e86 100644 --- a/addon.xml +++ b/addon.xml @@ -1,9 +1,8 @@ - + - - - + + audio @@ -19,10 +18,8 @@ https://forum.kodi.tv/showthread.php?tid=206635 https://soundcloud.com https://github.com/jaylinski/kodi-addon-soundcloud - 3.2.0 (2020-04-18) -[fix] Custom client ID won't be overwritten anymore -[new] Added ability to clear cache in settings -[new] Track descriptions can now be viewed in info window + 4.0.0 (2020-12-12) +Added support for Kodi v19 (Matrix) resources/icon.png diff --git a/resources/language/resource.language.de_de/strings.po b/resources/language/resource.language.de_de/strings.po index 1615055..7f9588d 100644 --- a/resources/language/resource.language.de_de/strings.po +++ b/resources/language/resource.language.de_de/strings.po @@ -41,11 +41,6 @@ msgctxt "#30013" msgid "History size" msgstr "Größe der Suchhistorie" -# Settings - Advanced -msgctxt "#30051" -msgid "Advanced" -msgstr "Fortgeschritten" - msgctxt "#30060" msgid "API v2" msgstr "API v2" diff --git a/resources/language/resource.language.en_gb/strings.po b/resources/language/resource.language.en_gb/strings.po index d51c27c..86fbf14 100644 --- a/resources/language/resource.language.en_gb/strings.po +++ b/resources/language/resource.language.en_gb/strings.po @@ -41,11 +41,6 @@ msgctxt "#30013" msgid "History size" msgstr "" -# Settings - Advanced -msgctxt "#30051" -msgid "Advanced" -msgstr "" - msgctxt "#30060" msgid "API v2" msgstr "" diff --git a/resources/language/resource.language.nl_nl/strings.po b/resources/language/resource.language.nl_nl/strings.po index 85ae710..74c9346 100644 --- a/resources/language/resource.language.nl_nl/strings.po +++ b/resources/language/resource.language.nl_nl/strings.po @@ -40,11 +40,6 @@ msgctxt "#30013" msgid "History size" msgstr "Zoekgeschiedenis grootte" -# Settings - Advanced -msgctxt "#30051" -msgid "Advanced" -msgstr "Geavanceerd" - msgctxt "#30060" msgid "API v2" msgstr "" diff --git a/resources/lib/kodi/items.py b/resources/lib/kodi/items.py index ce67d5c..e8002c2 100644 --- a/resources/lib/kodi/items.py +++ b/resources/lib/kodi/items.py @@ -1,6 +1,3 @@ -from future import standard_library -standard_library.install_aliases() # noqa: E402 - from resources.lib.kodi.utils import format_bold from resources.routes import * diff --git a/resources/lib/kodi/vfs.py b/resources/lib/kodi/vfs.py index 7442e4a..6cc6fcd 100644 --- a/resources/lib/kodi/vfs.py +++ b/resources/lib/kodi/vfs.py @@ -12,19 +12,15 @@ def __init__(self, path): def read(self, filename): filepath = os.path.join(self.path, filename) if xbmcvfs.exists(filepath): - file = xbmcvfs.File(filepath) - string = file.read() - file.close() - return string + with xbmcvfs.File(filepath) as file: + return file.read() else: return None def write(self, filename, string): filepath = os.path.join(self.path, filename) - file = xbmcvfs.File(filepath, "w") - success = file.write(string) - file.close() - return filepath if success else False + with xbmcvfs.File(filepath, "w") as file: + return filepath if file.write(string) else False def remove_dir(self, path): dir_list, file_list = xbmcvfs.listdir(path) diff --git a/resources/lib/models/playlist.py b/resources/lib/models/playlist.py index 2519efd..fead064 100644 --- a/resources/lib/models/playlist.py +++ b/resources/lib/models/playlist.py @@ -1,6 +1,3 @@ -from future import standard_library -standard_library.install_aliases() # noqa: E402 - from resources.lib.models.list_item import ListItem import urllib.parse import xbmcgui diff --git a/resources/lib/models/selection.py b/resources/lib/models/selection.py index 61cbaf2..a21f69c 100644 --- a/resources/lib/models/selection.py +++ b/resources/lib/models/selection.py @@ -1,6 +1,3 @@ -from future import standard_library -standard_library.install_aliases() # noqa: E402 - from resources.lib.models.list_item import ListItem from resources.routes import * import urllib.parse diff --git a/resources/lib/models/track.py b/resources/lib/models/track.py index a91a543..7791a8e 100644 --- a/resources/lib/models/track.py +++ b/resources/lib/models/track.py @@ -1,6 +1,3 @@ -from future import standard_library -standard_library.install_aliases() # noqa: E402 - from resources.lib.models.list_item import ListItem import urllib.parse import xbmcaddon diff --git a/resources/lib/models/user.py b/resources/lib/models/user.py index 4abe267..52b9207 100644 --- a/resources/lib/models/user.py +++ b/resources/lib/models/user.py @@ -1,6 +1,3 @@ -from future import standard_library -standard_library.install_aliases() # noqa: E402 - from resources.lib.models.list_item import ListItem from resources.routes import * import urllib.parse diff --git a/resources/lib/soundcloud/api_interface.py b/resources/lib/soundcloud/api_interface.py index df91226..33062dd 100644 --- a/resources/lib/soundcloud/api_interface.py +++ b/resources/lib/soundcloud/api_interface.py @@ -1,8 +1,7 @@ -from future.utils import with_metaclass from abc import ABCMeta, abstractmethod -class ApiInterface(with_metaclass(ABCMeta)): +class ApiInterface(metaclass=ABCMeta): @abstractmethod def search(self, query, kind): pass diff --git a/resources/lib/soundcloud/api_v2.py b/resources/lib/soundcloud/api_v2.py index 3f27341..e9fea7f 100644 --- a/resources/lib/soundcloud/api_v2.py +++ b/resources/lib/soundcloud/api_v2.py @@ -1,6 +1,3 @@ -from future import standard_library -standard_library.install_aliases() # noqa: E402 - import hashlib import json import re diff --git a/resources/plugin.py b/resources/plugin.py index 2931c75..8864d79 100644 --- a/resources/plugin.py +++ b/resources/plugin.py @@ -1,7 +1,3 @@ -from future import standard_library -from future.utils import PY2 -standard_library.install_aliases() # noqa: E402 - from resources.lib.soundcloud.api_v2 import ApiV2 from resources.lib.kodi.cache import Cache from resources.lib.kodi.items import Items @@ -16,13 +12,12 @@ import xbmcaddon import xbmcgui import xbmcplugin +import xbmcvfs addon = xbmcaddon.Addon() addon_id = addon.getAddonInfo("id") addon_base = "plugin://" + addon_id -addon_profile_path = xbmc.translatePath(addon.getAddonInfo("profile")) -if PY2: - addon_profile_path = addon_profile_path.decode("utf-8") +addon_profile_path = xbmcvfs.translatePath(addon.getAddonInfo("profile")) vfs = VFS(addon_profile_path) vfs_cache = VFS(os.path.join(addon_profile_path, "cache")) settings = Settings(addon) diff --git a/resources/settings.xml b/resources/settings.xml index b1ad982..c9792a3 100644 --- a/resources/settings.xml +++ b/resources/settings.xml @@ -1,17 +1,88 @@ - - - - - - - - - - - - - - - + +
+ + + + 0 + 2 + + + + + + + + + + + + + 0 + 20 + + + + + + + + + + + + + + + + 0 + 10 + + + + + + + + + + + + + + + + + 3 + + + true + + + 30061 + + + + 2 + 0 + + + + + + + + + + + + 1 + RunPlugin(plugin://plugin.audio.soundcloud/settings/cache/clear/) + + true + + + + +