yutipy 2.2.5__tar.gz → 2.2.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of yutipy might be problematic. Click here for more details.
- {yutipy-2.2.5 → yutipy-2.2.6}/PKG-INFO +1 -1
- {yutipy-2.2.5 → yutipy-2.2.6}/docs/api_reference.rst +0 -6
- {yutipy-2.2.5 → yutipy-2.2.6}/tests/test_lastfm.py +2 -1
- {yutipy-2.2.5 → yutipy-2.2.6}/yutipy/lastfm.py +5 -3
- {yutipy-2.2.5 → yutipy-2.2.6}/yutipy.egg-info/PKG-INFO +1 -1
- {yutipy-2.2.5 → yutipy-2.2.6}/.gitattributes +0 -0
- {yutipy-2.2.5 → yutipy-2.2.6}/.github/FUNDING.yml +0 -0
- {yutipy-2.2.5 → yutipy-2.2.6}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {yutipy-2.2.5 → yutipy-2.2.6}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {yutipy-2.2.5 → yutipy-2.2.6}/.github/dependabot.yml +0 -0
- {yutipy-2.2.5 → yutipy-2.2.6}/.github/workflows/pytest-unit-testing.yml +0 -0
- {yutipy-2.2.5 → yutipy-2.2.6}/.github/workflows/release.yml +0 -0
- {yutipy-2.2.5 → yutipy-2.2.6}/.gitignore +0 -0
- {yutipy-2.2.5 → yutipy-2.2.6}/.readthedocs.yaml +0 -0
- {yutipy-2.2.5 → yutipy-2.2.6}/LICENSE +0 -0
- {yutipy-2.2.5 → yutipy-2.2.6}/MANIFEST.in +0 -0
- {yutipy-2.2.5 → yutipy-2.2.6}/README.md +0 -0
- {yutipy-2.2.5 → yutipy-2.2.6}/docs/Makefile +0 -0
- {yutipy-2.2.5 → yutipy-2.2.6}/docs/_static/yutipy_header.png +0 -0
- {yutipy-2.2.5 → yutipy-2.2.6}/docs/_static/yutipy_logo.png +0 -0
- {yutipy-2.2.5 → yutipy-2.2.6}/docs/available_platforms.rst +0 -0
- {yutipy-2.2.5 → yutipy-2.2.6}/docs/cli.rst +0 -0
- {yutipy-2.2.5 → yutipy-2.2.6}/docs/conf.py +0 -0
- {yutipy-2.2.5 → yutipy-2.2.6}/docs/faq.rst +0 -0
- {yutipy-2.2.5 → yutipy-2.2.6}/docs/index.rst +0 -0
- {yutipy-2.2.5 → yutipy-2.2.6}/docs/installation.rst +0 -0
- {yutipy-2.2.5 → yutipy-2.2.6}/docs/make.bat +0 -0
- {yutipy-2.2.5 → yutipy-2.2.6}/docs/requirements.txt +0 -0
- {yutipy-2.2.5 → yutipy-2.2.6}/docs/usage_examples.rst +0 -0
- {yutipy-2.2.5 → yutipy-2.2.6}/pyproject.toml +0 -0
- {yutipy-2.2.5 → yutipy-2.2.6}/requirements-dev.txt +0 -0
- {yutipy-2.2.5 → yutipy-2.2.6}/requirements.txt +0 -0
- {yutipy-2.2.5 → yutipy-2.2.6}/setup.cfg +0 -0
- {yutipy-2.2.5 → yutipy-2.2.6}/tests/__init__.py +0 -0
- {yutipy-2.2.5 → yutipy-2.2.6}/tests/test_deezer.py +0 -0
- {yutipy-2.2.5 → yutipy-2.2.6}/tests/test_itunes.py +0 -0
- {yutipy-2.2.5 → yutipy-2.2.6}/tests/test_kkbox.py +0 -0
- {yutipy-2.2.5 → yutipy-2.2.6}/tests/test_models.py +0 -0
- {yutipy-2.2.5 → yutipy-2.2.6}/tests/test_musicyt.py +0 -0
- {yutipy-2.2.5 → yutipy-2.2.6}/tests/test_spotify.py +0 -0
- {yutipy-2.2.5 → yutipy-2.2.6}/tests/test_utils.py +0 -0
- {yutipy-2.2.5 → yutipy-2.2.6}/yutipy/__init__.py +0 -0
- {yutipy-2.2.5 → yutipy-2.2.6}/yutipy/cli/__init__.py +0 -0
- {yutipy-2.2.5 → yutipy-2.2.6}/yutipy/cli/config.py +0 -0
- {yutipy-2.2.5 → yutipy-2.2.6}/yutipy/cli/search.py +0 -0
- {yutipy-2.2.5 → yutipy-2.2.6}/yutipy/deezer.py +0 -0
- {yutipy-2.2.5 → yutipy-2.2.6}/yutipy/exceptions.py +0 -0
- {yutipy-2.2.5 → yutipy-2.2.6}/yutipy/itunes.py +0 -0
- {yutipy-2.2.5 → yutipy-2.2.6}/yutipy/kkbox.py +0 -0
- {yutipy-2.2.5 → yutipy-2.2.6}/yutipy/logger.py +0 -0
- {yutipy-2.2.5 → yutipy-2.2.6}/yutipy/models.py +0 -0
- {yutipy-2.2.5 → yutipy-2.2.6}/yutipy/musicyt.py +0 -0
- {yutipy-2.2.5 → yutipy-2.2.6}/yutipy/spotify.py +0 -0
- {yutipy-2.2.5 → yutipy-2.2.6}/yutipy/utils/__init__.py +0 -0
- {yutipy-2.2.5 → yutipy-2.2.6}/yutipy/utils/helpers.py +0 -0
- {yutipy-2.2.5 → yutipy-2.2.6}/yutipy/yutipy_music.py +0 -0
- {yutipy-2.2.5 → yutipy-2.2.6}/yutipy.egg-info/SOURCES.txt +0 -0
- {yutipy-2.2.5 → yutipy-2.2.6}/yutipy.egg-info/dependency_links.txt +0 -0
- {yutipy-2.2.5 → yutipy-2.2.6}/yutipy.egg-info/entry_points.txt +0 -0
- {yutipy-2.2.5 → yutipy-2.2.6}/yutipy.egg-info/requires.txt +0 -0
- {yutipy-2.2.5 → yutipy-2.2.6}/yutipy.egg-info/top_level.txt +0 -0
|
@@ -132,12 +132,6 @@ Generic Exceptions
|
|
|
132
132
|
:noindex:
|
|
133
133
|
:exclude-members: add_note, args, with_traceback
|
|
134
134
|
|
|
135
|
-
.. autoclass:: yutipy.exceptions.NetworkException
|
|
136
|
-
:members:
|
|
137
|
-
:inherited-members:
|
|
138
|
-
:noindex:
|
|
139
|
-
:exclude-members: add_note, args, with_traceback
|
|
140
|
-
|
|
141
135
|
Service Exceptions
|
|
142
136
|
------------------
|
|
143
137
|
|
|
@@ -34,6 +34,7 @@ class MockResponseActivity(BaseResponse):
|
|
|
34
34
|
"#text": "Test Album",
|
|
35
35
|
},
|
|
36
36
|
"name": "Test Track",
|
|
37
|
+
"@attr": {"nowplaying": True},
|
|
37
38
|
"url": "https://www.last.fm/music/test+track",
|
|
38
39
|
}
|
|
39
40
|
]
|
|
@@ -88,7 +89,7 @@ def test_get_currently_playing(lastfm, mock_response_activity):
|
|
|
88
89
|
assert currently_playing.title == "Test Track"
|
|
89
90
|
assert currently_playing.album_title == "Test Album"
|
|
90
91
|
assert "extralarge" in currently_playing.album_art
|
|
91
|
-
assert currently_playing.is_playing is
|
|
92
|
+
assert currently_playing.is_playing is True
|
|
92
93
|
|
|
93
94
|
|
|
94
95
|
def test_get_user_profile(lastfm, mock_response_profile):
|
|
@@ -2,6 +2,7 @@ __all__ = ["LastFm", "LastFmException"]
|
|
|
2
2
|
|
|
3
3
|
import os
|
|
4
4
|
from dataclasses import asdict
|
|
5
|
+
from time import time
|
|
5
6
|
from pprint import pprint
|
|
6
7
|
from typing import Optional
|
|
7
8
|
|
|
@@ -140,7 +141,8 @@ class LastFm:
|
|
|
140
141
|
|
|
141
142
|
response_json = response.json()
|
|
142
143
|
result = response_json.get("recenttracks", {}).get("track", [])[0]
|
|
143
|
-
|
|
144
|
+
is_playing = result.get("@attr", {}).get("nowplaying", False)
|
|
145
|
+
if result and is_playing:
|
|
144
146
|
album_art = [
|
|
145
147
|
img.get("#text")
|
|
146
148
|
for img in result.get("image", [])
|
|
@@ -153,10 +155,10 @@ class LastFm:
|
|
|
153
155
|
separate_artists(result.get("artist", {}).get("#text"))
|
|
154
156
|
),
|
|
155
157
|
id=result.get("mbid"),
|
|
156
|
-
timestamp=result.get("date", {}).get("uts"),
|
|
158
|
+
timestamp=result.get("date", {}).get("uts") or time(),
|
|
157
159
|
title=result.get("name"),
|
|
158
160
|
url=result.get("url"),
|
|
159
|
-
is_playing=
|
|
161
|
+
is_playing=is_playing,
|
|
160
162
|
)
|
|
161
163
|
return None
|
|
162
164
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|