slimserver icon indicating copy to clipboard operation
slimserver copied to clipboard

Bug: Musik- und Interpreten-Information (v1.11.2)

Open schnillerman opened this issue 1 year ago • 5 comments

Pictures of artists that have special characters in their name are saved with filenames that causes re-downloading into the cache directory upon every library scan.

Screenshot_20240210_101704_MiXplorer.jpg

Pictures of artists without special chars are reused and remain in cache.

schnillerman avatar Feb 10 '24 09:02 schnillerman

Data is stored on a Synology? How do the characters look there? How are you accessing it? What OS is LMS running on? What LMS version?

mherger avatar Feb 10 '24 16:02 mherger

Characters there look crooked as well:

ConnectBot.jpg (See e.g. Wolfgang Müller)

LMS version and environment:

Logitech Media Server-Status Logitech Media Server Version: 8.4.1 - 1707395499 @ Thu Feb 8 14:21:09 CET 2024 Hostname: DISKSTATION01 IP-Adresse des Servers: 192.168.1.11 Server-HTTP-Portnummer: 9000 Betriebssystem: Debian (Docker) - DE - utf8 Plattformarchitektur: x86_64-linux Datenbankversion: SQLite Anzahl erkannter Player: 3

Perl- und Modulversionen Perl-Version: 5.32.1 - x86_64-linux-gnu-thread-multi Audio::Scan: 1.06 DBD::SQLite: 1.58 (sqlite 3.22.0) IO::Socket::SSL: 2.069 Mozilla::CA: Net::SSLeay: 1.88 - OpenSSL 1.1.1w 11 Sep 2023

schnillerman avatar Feb 10 '24 19:02 schnillerman

Now that's actually very interesting that the .missing file was using correct encoding, while the image file didn't. If you renamed one of those image files to the name used by the .missing file, would that be picked up?

mherger avatar Feb 12 '24 05:02 mherger

Yes, with the missing file's name now it has been picked up.

schnillerman avatar Feb 15 '24 22:02 schnillerman

Wow... that's really odd. I tried to understand the difference. Here's the working code flow for the .missing file:

my $file = Plugins::MusicArtistInfo::Importer::filename('', $imageFolder, $artist->{name});
$file =~ s/\.$/\.missing/;
File::Slurp::write_file($file, { err_mode => 'carp' }, '');

And this one isn't working:

$file = Plugins::MusicArtistInfo::Importer::filename($url, $imageFolder, $artist->{name});
File::Slurp::write_file($file, { err_mode => 'carp' }, $cached->{data_ref});

I'll have to come up with a setup where I can reproduce this. The only difference seems to be that in the former case we apply a regex to append the suffix. In the latter we extract that suffix from another string.

michaelherger avatar Feb 16 '24 02:02 michaelherger

Unfortunately Github doesn't allow us to move issues across organizations. May I ask you to please open an issue over in the MAI repository (https://github.com/michaelherger/MusicArtistInfo/issues) and link to this one? Thanks!

michaelherger avatar Mar 28 '24 06:03 michaelherger