Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File: Implemented get_images for file library #1925

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

parth-verma
Copy link
Contributor

@parth-verma parth-verma commented Jul 18, 2020

  • Fetches image from track metadata if available.

  • Introduced new extension variable folder_image_names to configure the image names for folder-based cover arts.

  • Fetches folder based image if present and name matches one of the names in folder_image_names.

  • Returns a tuple of Image for each uri.

  • The image uri is base64 encoded so that it is accessible to clients other than localhost.

  • Added error handling incase _scanner.scan fails

@codecov
Copy link

codecov bot commented Jul 18, 2020

Codecov Report

Merging #1925 into develop will decrease coverage by 0.26%.
The diff coverage is 21.73%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1925      +/-   ##
===========================================
- Coverage    76.78%   76.51%   -0.27%     
===========================================
  Files           55       55              
  Lines         4691     4714      +23     
===========================================
+ Hits          3602     3607       +5     
- Misses        1089     1107      +18     
Impacted Files Coverage Δ
mopidy/file/library.py 32.40% <21.73%> (-2.89%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c52bfba...b021af6. Read the comment docs.

@parth-verma parth-verma force-pushed the feature/1895-mopidy-file-get-images branch 3 times, most recently from cb67ec3 to 57678c7 Compare July 18, 2020 12:36
@parth-verma
Copy link
Contributor Author

Implements #1895

* Added get_images implementation to extract artwork from metadata and store in cache_dir.
@parth-verma parth-verma force-pushed the feature/1895-mopidy-file-get-images branch from 57678c7 to 7f189d2 Compare July 18, 2020 12:50
Copy link
Member

@kingosticks kingosticks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think updating the commit message with a brief explanation of how this works would be helpful. We could also do with more tests exercising the various ways this can fail, some of which are not yet handled. Note I am still yet to actually test this myself.

mopidy/file/library.py Outdated Show resolved Hide resolved
mopidy/file/library.py Outdated Show resolved Hide resolved
mopidy/file/library.py Outdated Show resolved Hide resolved
mopidy/file/library.py Outdated Show resolved Hide resolved
mopidy/file/library.py Outdated Show resolved Hide resolved
mopidy/file/library.py Outdated Show resolved Hide resolved
mopidy/file/library.py Outdated Show resolved Hide resolved
* Fetches image from track metadata if available.

* Introduced new extension variable `folder_image_names` to configure the image names for folder-based cover arts.

* Fetches folder based image if present and name matches one of the names in `folder_image_names`.

* Returns a tuple of Image for each uri.

* The image uri is base64 encoded so that it is accessible to clients other than localhost.

* Added error handling incase _scanner.scan fails
@parth-verma parth-verma force-pushed the feature/1895-mopidy-file-get-images branch from 0dd0045 to b021af6 Compare July 20, 2020 15:00
continue
for i in self._folder_image_names:
if (path.uri_to_path(uri).parent / i).exists():
with open(path.uri_to_path(uri).parent / i, "rb",) as f:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The trailing comma near the end of the open() call can be removed.

@jjok
Copy link
Contributor

jjok commented Jun 29, 2021

It would be great to get this one merged. Is any help needed?

@djmattyg007
Copy link
Contributor

Since this was last worked on, the project has been moved to Github Actions. At the very least it will need to be rebased on top of the master branch and force-pushed so that the latest CI can run.

@parth-verma Do you think you'll have time to do this in the near future? If not, I'll see if I can pick it up.

@jodal jodal deleted the branch mopidy:main March 1, 2024 23:15
@jodal jodal closed this Mar 1, 2024
@jodal jodal reopened this Mar 1, 2024
@jodal jodal changed the base branch from develop to main March 1, 2024 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants