Skip to content

Commit

Permalink
library: some providers has bug in provider.song_get :( (#773)
Browse files Browse the repository at this point in the history
  • Loading branch information
cosven authored Jan 20, 2024
1 parent a9f1258 commit 4416fee
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions feeluown/library/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,8 @@ def _model_upgrade(self, model):
elif e.reason is ModelNotFound.Reason.not_supported:
model.state = ModelState.cant_upgrade
raise
if upgraded_model is None: # some provider does not implement
raise ModelNotFound(f'{provider} implementation error, it returns None :(')
return upgraded_model

# --------
Expand Down
3 changes: 3 additions & 0 deletions feeluown/library/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ def identifier(self):
def name(self):
"""provider name"""

def __str__(self):
return f'provider:{self.identifier}'

@contextmanager
def auth_as(self, user):
"""auth as a user temporarily
Expand Down

0 comments on commit 4416fee

Please sign in to comment.