Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Solved: Show default cover when fail extract embedded image
#1
Hello,

I have some files which do not have embedded cover arts, and moode will extract cover art from other files, is it possible to show default-cover-v6.svg in playback page instead of a incorrect cover art?

Can I do something with the coverart.php? Please advise.
Reply
#2
Hi,

Is the usage scenario one where you have a directory of files from various artists/albums?

-Tim
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#3
(08-06-2018, 07:17 PM)Tim Curtis Wrote: Hi,

Is the usage scenario one where you have a directory of files from various artists/albums?

-Tim
Hello Tim,

Yes, and all my directories contain files without cover and files with cover, no image files present
Reply
#4
If coverart.php can't find embedded art in a track it looks for art in any track in the dir and if none found then it looks for a cover image file in the dir. Its basically assuming that either all the tracks in the dir belong to a single album and at least one of them has embedded art or if they are tracks from different albums then they all have embedded art.

So, changing it to use default cover would break the case where not all the tracks in an album dir have embedded art and there is no cover image file in the dir.

But maybe thats the corner case and its better to use default cover than wrong cover for dirs that have tracks from different albums some with cover art and some without. Dunno.

-Tim
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#5
(08-06-2018, 11:38 PM)Tim Curtis Wrote: If coverart.php can't find embedded art in a track it looks for art in any track in the dir and if none found then it looks for a cover image file in the dir. Its basically assuming that either all the tracks in the dir belong to a single album and at least one of them has embedded art or if they are tracks from different albums then they all have embedded art.

So, changing it to use default cover would break the case where not all the tracks in an album dir have embedded art and there is no cover image file in the dir.

But maybe thats the corner case and its better to use default cover than wrong cover for dirs that have tracks from different albums some with cover art and some without. Dunno.

-Tim

Understand, is there a way to break the case in coverart.php? I can manually add the cover back if I want, so modifying the php in my pi would be fine.
Reply
#6
It already has some code to change its behavior whereby it prefers an image file to an embedded cover but that also breaks another case, ugh. But maybe you could come up with some code for your particular case and we just add a third value (2) to the SEARCH_PRI define.

// image search priority
// 0: search for embedded image first (default)
// 1: search for image file first
define('SEARCH_PRI', 0);

-TIm
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#7
(08-07-2018, 12:20 AM)Tim Curtis Wrote: It already has some code to change its behavior whereby it prefers an image file to an embedded cover but that also breaks another case, ugh. But maybe you could come up with some code for your particular case and we just add a third value (2) to the SEARCH_PRI define.

// image search priority
// 0: search for embedded image first (default)
// 1: search for image file first
define('SEARCH_PRI', 0);

-TIm

Thanks Tim, I will try to add value 2 later
-------------------------------------------------------------------------------
I have just commented the part after // directory - try all files and before // nothing found -> default cover

It seems worked, edit the coverart.php requires login as root, that's all.
Reply


Forum Jump: