Skip to content

Commit

Permalink
ok to run
Browse files Browse the repository at this point in the history
  • Loading branch information
cosven committed Jan 6, 2024
1 parent 84b9a07 commit 0c8be82
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 2 additions & 0 deletions feeluown/app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ def apply_state(self, state):
song = resolve(song)
except ResolverNotFound:
pass
except ResolveFailed as e:
logger.warning(f'resolve failed, {e}')
else:
songs.append(song)
playlist.set_models(songs)
Expand Down
6 changes: 1 addition & 5 deletions feeluown/library/uri.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,7 @@ def resolve(line, model=None):
for example, line can be 'fuo://local/songs/1/cover/data'
"""
from feeluown.library import (
ProviderFlags, get_modelcls_by_type, V2SupportedModelTypes,
)
from feeluown.library import get_modelcls_by_type, V2SupportedModelTypes

if model is None:
model, path = parse_line(line)
Expand All @@ -263,8 +261,6 @@ def resolve(line, model=None):
if provider is None:
model.state = ModelState.not_exists
else:
# Try to use model v2 since v1 is deprecated.
assert library.check_flags_by_model(model, ProviderFlags.model_v2)
model_type = ModelType(model.meta.model_type)
modelcls = get_modelcls_by_type(model_type, brief=True)
assert modelcls is not None and model_type in V2SupportedModelTypes
Expand Down
4 changes: 3 additions & 1 deletion feeluown/server/handlers/search.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import logging

from feeluown.library import SupportsSongGet
from .base import AbstractHandler

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -31,7 +33,7 @@ def search(self, keyword, options=None):
"""
providers = self.library.list()
source_in = [provd.identifier for provd in providers
if provd.Song.meta.allow_get]
if isinstance(provd, SupportsSongGet)]
params = {}
if options is not None:
type_in = options.pop('type', None)
Expand Down

0 comments on commit 0c8be82

Please sign in to comment.