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

Feature: Expose fallback album art file(s) list to Configuration.JSON #379

Closed
victormatheusEK opened this issue Dec 25, 2022 · 11 comments
Closed
Assignees
Labels
improvement Improvement to already existing code

Comments

@victormatheusEK
Copy link

I have some albums where the music files don't have any artwork in itselves, but there is a jpg file with the album artwork on the album folder, but harmonoid doesn't seem to use it to set the album artwork on the application.

Would it be possible to set the app to search for the jpg (or any other image file type) in the album folder when this happens?
2022-12-25_19-43

@victormatheusEK victormatheusEK added the improvement Improvement to already existing code label Dec 25, 2022
@alexmercerind
Copy link
Member

Hi @victormatheusEK,

This is already possible in Harmonoid. Make sure to turn on "Lookup for fallback album arts" in the Settings.

fallback_album_arts

These images in the folder will be searched (following the priority):

  'Folder.jpg',
  'Folder.png',
  'AlbumArtSmall.jpg',
  'AlbumArt.jpg',
  'Album.jpg',
  '.folder.png',
  'cover.jpg',
  'cover.png',
  'cover.gif',
  'front.jpg',
  'front.png',
  'front.gif',
  'front.bmp',
  'thumb.jpg'

Thanks!

@alexmercerind
Copy link
Member

It should note that it is although marked as experimental, works perfectly fine.

@Not-Sure-Whats-Going-On

Is it possible to also add 'folder.jpg' to the list please?
I'm on Linux, so case sensitive, and all of my external album-art files are called 'folder.jpg.
Thanks for making this great player!

@alexmercerind alexmercerind reopened this Dec 26, 2022
@alexmercerind alexmercerind changed the title Add artwork from folder request: add folder.jpg to fallback album arts Dec 26, 2022
@Not-Sure-Whats-Going-On

Thanks!

@alexmercerind
Copy link
Member

Hi @Not-Sure-Whats-Going-On!

I will add it to the list. However, Folder.jpg is "the standard". You can refer to these lines in VLC's source code:

https://github.com/videolan/vlc/blob/e3b28612d38f925d92f9d7fd45ee6b337fe2dfe5/modules/meta_engine/folder.c#L40-L55


Besides this, next release might take some time to come out. There's a lot of stuff going on. Thanks!

@victormatheusEK
Copy link
Author

@alexmercerind This search for the artwork is case-sensitive? Because in my folder it has a Cover.jpg with an uppercase 'C'. The cover is not appearing on the albums even though I switched on the option and reindexed the files.

If it is case-sensitive, I know the solution is as simple as renaming the file, but wouldn't it be troublesome if it happens to several albums?

@Not-Sure-Whats-Going-On

Until only a few months ago I always used the standard Folder.jpg but recently had to change ~3500 files to folder.jpg in order to get a different player I was testing to display the images. In the end I didn't like the player and deleted it but the end result was a bunch of files with the wrong name. That'll teach me :-)

As an experiment I just renamed the external albumart of one album to Folder.jpg and refreshed the library and I can confirm that it displays OK in Album View mode. However, both the album thumbnail in the play-bar and on the "Modern Now-Playing" screen is just the default placeholder so it seems that renaming the external image files doesn't help there. Am I missing something?

@alexmercerind
Copy link
Member

alexmercerind commented Dec 26, 2022

This search for the artwork is case-sensitive?
Because in my folder it has a Cover.jpg with an uppercase 'C'.
The cover is not appearing on the albums even though I switched on the option and reindexed the files.

If it is case-sensitive, I know the solution is as simple as renaming the file, but wouldn't it be troublesome if it happens to several albums?

TL;DR

Best idea: Expose this "fallback album arts" list in the Configuration.JSON & let users decide.

And add this to UI too once I get time.


Currently, the fallback album arts are "looked-up" at the time of rendering. In other words:

  • The embedded album arts are cached during the first time indexing (because we can't extract them each time, very expensive).
  • The fallback album arts are not cached but looked at the time of rendering itself (in a "chained" fashion, list is given above).

If embedded album art is not found, Harmonoid looks for fallback album arts. 'Folder.jpg' exists? Use it. Not exists? ... 'Folder.png'exists? Use it. Not exists? ... 'AlbumArtSmall.jpg'exists? Use it. Not exists? ... 'AlbumArt.jpg' exists? Use it. Not exists? ... .

What this means is that, if you remove or add the "fallback album art" in your folder, Harmonoid should be able to see the changes without any "re-index" because it is being done at the time of rendering. However... as you can tell that checking existence of a File is an I/O operation, which can add redundant delay & jitter in the UI.

  • One solution can be to iterate over the files in the music file's directory, however, iterating is going to be even worse.
    Some lazy lads like me just throw all the files in same folder & let music player do the job 😄.
  • Another solution can be let's say I check for "non-case sensitive file existence" on GNU/Linux filesystem, this means 2^(n - 1) checks for each file name, where (n - 1) is the length of file name excluding . (e.g. Folder.jpg).

Best idea: Expose this "fallback album arts" list in the Configuration.JSON & let users decide. All of the Harmonoid's configuration is present in ~/.Harmonoid/Configuration.JSON, it also gives ability to set custom libmpv flags etc. etc.

@alexmercerind alexmercerind changed the title request: add folder.jpg to fallback album arts Feature: Expose fallback album art file(s) list to Configuration.JSON Dec 26, 2022
@alexmercerind
Copy link
Member

Hi @victormatheusEK & @Not-Sure-Whats-Going-On,

Please install the latest nightly build.
You'll be able to configure the fallback album arts. It's in ~/.Harmonoid/Configuration.JSON. I'll add this to UI in future.

fallback_album_arts

Thanks! Happy new year! 🎊


Since, this is a nightly build, few things might not work as intended (though I feel it's fairly stable).
I'm working actively to ensure stability & feature completeness of Harmonoid. Thanks for using it!

Leaving issue opened till next stable release.

@alexmercerind
Copy link
Member

Just wanted to say that keyboard shortcuts are broken in this build.

@alexmercerind
Copy link
Member

v0.3.5 is released. Download latest version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improvement to already existing code
Projects
None yet
Development

No branches or pull requests

3 participants