Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
script.spotify.screensaver
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
kodi
script.spotify.screensaver
Commits
477f3cfd
Commit
477f3cfd
authored
2 years ago
by
Benoît Harrault
Browse files
Options
Downloads
Plain Diff
Merge branch '20-fix-get-image-refresh-access-token' into 'master'
Resolve "Fix get image, refresh access token" Closes
#20
See merge request
!16
parents
b9d57f99
08169b72
No related branches found
No related tags found
1 merge request
!16
Resolve "Fix get image, refresh access token"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
addon.xml
+1
-1
1 addition, 1 deletion
addon.xml
gui.py
+10
-1
10 additions, 1 deletion
gui.py
with
11 additions
and
2 deletions
addon.xml
+
1
−
1
View file @
477f3cfd
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon
id=
"script.spotify.screensaver"
name=
"Spotify Screensaver"
version=
"0.0.1
1
"
version=
"0.0.1
2
"
provider-name=
"Benoît Harrault"
>
<requires>
<import
addon=
"xbmc.python"
version=
"2.25.0"
/>
...
...
This diff is collapsed.
Click to expand it.
gui.py
+
10
−
1
View file @
477f3cfd
...
...
@@ -161,8 +161,9 @@ class GUI(xbmcgui.WindowXMLDialog):
self
.
PanelItems
=
self
.
getControl
(
101
)
self
.
PanelItems
.
reset
()
def
_get_track_data
(
self
,
track_id
):
def
_get_track_data
(
self
,
track_id
,
try_count
=
1
):
self
.
log
(
'
track_id: [
'
+
str
(
track_id
)
+
'
]
'
)
self
.
log
(
'
(try:
'
+
str
(
try_count
)
+
'
)
'
)
imageLST
=
[]
...
...
@@ -186,6 +187,14 @@ class GUI(xbmcgui.WindowXMLDialog):
if
album
is
None
:
self
.
log
(
'
failed to get album from API
'
,
xbmc
.
LOGERROR
)
self
.
log
(
json
.
dumps
(
data
),
xbmc
.
LOGERROR
)
if
json
.
dumps
(
data
)
==
'
{
"
error
"
: {
"
status
"
: 401,
"
message
"
:
"
The access token expired
"
}}
'
:
self
.
log
(
'
trying to refresh access token
'
)
self
.
_init_spotify_access_token
()
self
.
log
(
'
retry get image
'
)
self
.
_get_track_data
(
track_id
,
try_count
+
1
)
else
:
self
.
log
(
'
unknown error getting image
'
,
xbmc
.
LOGERROR
)
else
:
self
.
log
(
'
ok got album from API
'
)
self
.
log
(
json
.
dumps
(
album
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment