Thank you for your donation!


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


Problem: Changes in JS
#15
(06-13-2022, 08:38 PM)TheOldPresbyope Wrote: @TheOldPresbyope

(...)

Not so in the case of an album-per-file FLAC with embedded coverart + CUE file and no folder.jpg file. The thumbnail displays are correct but the default cover ("images/default-cover-v6-l.svg") is displayed in place of the album coverart.

Changing the cover search priority has no effect.

It appears coverart.php is being passed a coverurl value based on the CUE file [1] and not the FLAC file. I haven't tried to read the PHP code involved but I'm supposing that if it fails to extract an image then it fails back on the separate image file if it exists, else the default cover image gets used.

To test this hypothesis, I simply added a folder.jpg file to the directory containing the album-per-file FLAC with no embedded coverart. Presto Chango, I now get coverart displayed for this case.

Well, the embedded cover art is extracted ONLY from flac/mp3 and the like (actual audio files with an image-tag), CUEs don't have such a thing, so they are "parsed" for cover art (but there is no case for "cue"), but revert to the "folder.jpg". If that is not found, of course, the default cover art is returned by the PHP code.

One possible solution (but this will be consistent only for CUEs that do not contain multiple audio-files, possibly each with different cover art..):
Write a CUE parser, if one isn't already out there... replace the received path "/some/path/to/file.cue" with "/some/path/to/file.<ext>", and from here proceed with album-art extracting code... not trivial, though, I still prefer to have the "folder.jpg" file in the directory where flac + cue are.
Also, this would return the album-art of the first audio-file in the cue (if multi-artist), and this could be nonsense... and to check for only one FILE entry in the cue could be overkill...

But nevertheless, if you consider it a nice improvement about the CUE thing, I'll be happy to implement it...


(06-13-2022, 08:38 PM)TheOldPresbyope Wrote: If my supposition is incorrect, then perhaps I somehow screwed up installing your code.

Regards,
Kent

[1] example for a directory which happens to be on a USB thumbdrive:  USB/RALLY8GB/Music/Green Day/Warning_/Green Day - Warning_.cue/track0001

As I said, this is the expected behavior, as of now.

Your example file is the de-facto syntax that the cover-art extractor is given in case of single tracks played out of a CUE.

What my code does is the following:

get pathinfo(path, PATHINFO_BASENAME), and see if its first 5 characters are "track"; if so, get pathinfo(pathinfo(path, PATHINFO_DIRNAME), EXTENSION), and if this is "cue", then get its containing directory => and this will find out folder.jpg or the default cover, if missing.

in your example above:
pathinfo(path, PATHINFO_BASENAME) => track0001 => substr(0, 5) = "track" TRUE
pathinfo(pathinfo(path, PATHINFO_DIRNAME), EXTENSION) = "cue" TRUE

thus returning "USB/RALLY8GB/Music/Green Day/Warning_"

Nothing fancy, all in all it was you who said that CUEs are both files AND (virtual) directories... and here they behave as if they were a directory containing the single tracks. ;-)

Thank you for your time and observations, that keeps me motivated.

Let me know your thoughts, anyway.

Cheers, Al.
Reply


Messages In This Thread
Changes in JS - by Nutul - 06-07-2022, 06:41 PM
RE: Changes in JS - by TheOldPresbyope - 06-07-2022, 06:52 PM
RE: Changes in JS - by Nutul - 06-07-2022, 07:21 PM
RE: Changes in JS - by Tim Curtis - 06-07-2022, 07:12 PM
RE: Changes in JS - by Nutul - 06-07-2022, 07:28 PM
RE: Changes in JS - by Tim Curtis - 06-07-2022, 08:02 PM
RE: Changes in JS - by Nutul - 06-08-2022, 11:24 PM
RE: Changes in JS - by Nutul - 06-09-2022, 07:17 PM
RE: Changes in JS - by Tim Curtis - 06-09-2022, 09:29 PM
RE: Changes in JS - by Nutul - 06-09-2022, 10:32 PM
RE: Changes in JS - by bitlab - 06-09-2022, 07:40 PM
RE: Changes in JS - by TheOldPresbyope - 06-10-2022, 03:43 AM
RE: Changes in JS - by Nutul - 06-10-2022, 09:24 AM
RE: Changes in JS - by TheOldPresbyope - 06-13-2022, 08:38 PM
RE: Changes in JS - by Nutul - 06-15-2022, 07:53 AM
RE: Changes in JS - by TheOldPresbyope - 06-16-2022, 07:48 PM
RE: Changes in JS - by Tim Curtis - 06-16-2022, 10:24 PM
RE: Changes in JS - by Nutul - 06-16-2022, 11:27 PM

Forum Jump: