Thank you for your donation!


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


Inconsistent Tag View behaviour.
#21
Hacking the album search at the end of filterLib was clearly a horrible place to do it. When I click an album after clicking an artist things break. So I just changed the filterAlbums call to do a search by artist by using the songs then going back to the albums so it can find artists other than the album artist. Here's all the changes I made in a diff.

I still don't claim this is the most efficient way to do the song -> album via artist (not Album_Artist) search, nor to keep the full artist list sorted.

I also verified that album art issues in genre happen even without any of these mods.

Code:
diff scripts-library.js.orig scripts-library.js
101c101
<       var artist = (track.album_artist || track.artist).toLowerCase();
---
>       var artist = (track.artist || track.album_artist).toLowerCase();
104c104
<               acc[artist].artist = track.album_artist || track.artist;
---
>               acc[artist].artist = track.artist || track.album_artist;
349a350
>       filteredArtists.sort();
363,364c364,367
<               filteredAlbums = filteredAlbums.filter(filterByArtist);
<               filteredAlbumCovers = filteredAlbumCovers.filter(filterByArtist);
---
>               artistSongs = allSongs.filter(filterByArtist);
>               songKeys = artistSongs.map(a => a.key)
>               filteredAlbums = filteredAlbums.filter(function(item){return songKeys.includes(keyAlbum(item));});
>               filteredAlbumCovers = filteredAlbumCovers.filter(function(item){return songKeys.includes(keyAlbum(item));});
1226d1228
<

I'll stop and leave you in peace now. Smile
Reply
#22
Not sure what the "album art / genre" issues are. If I select a genre in my collection for example "Electronica" it lists the artists and albums some of which are compilation albums. The artist thats listed for the compilation albums is "Various Artists"
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#23
(09-14-2020, 01:24 AM)Tim Curtis Wrote: Not sure what the "album art / genre" issues are. If I select a genre in my collection for example "Electronica" it lists the artists and albums some of which are compilation albums. The artist thats listed for the compilation albums is "Various Artists"
Oh it's just a minor cosmetic thing I noticed when testing my mods. When I select some genres I get album art to the left of the track list to go with the first album listed in the genre. Other times I get no album art even though the first album has art.

It doesn't seem anyway related to compilation albums. I just noticed it when testing my mods and wasn't sure if my mods were the cause. It happens without my mods so obviously not related.

I see the same issue with Lana Del Rey in my library with the mods now that it brings up both albums instead of one.
Reply
#24
You would see album art if the genre had only one artist and the artist had only one album, otherwise you would see the Genre Name. At least thats how its supposed to work i.e if there is only one album in the list then show its cover.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#25
(09-14-2020, 01:41 AM)Tim Curtis Wrote: You would see album art if the genre had only one artist and the artist had only one album, otherwise you would see the Genre Name. At least thats how its supposed to work i.e if there is only one album in the list then show its cover.

Ah. Yes that is exactly how it works. And that's how it's working with my mods. More than 1 album shows the artist name.

Sorry, I don't use genre mode much and don't have a lot of artists with more than one album so I never caught the pattern until I got the second Lana Del Rey album to show up and the album art suddenly disappeared.

I think the mods are safe from repeating albums because your album list still only contains each album once, and the only way to make the compilation album to multiple artist connection is to go through the song list itself, which only happens if searching for a given artist. And if that "artist" is the compilation tag, it's still ok as that just finds the connections you have already stored in your album list. (Yes I've tried this case.)
Reply
#26
One more change. Use your custom article removing/case insensitive sort for the artist list.

replace
Code:
filteredArtists.sort();

with

Code:
filteredArtists.sort(function(a, b) {
                        a = removeArticles(a).toLowerCase();
                        b = removeArticles(b).toLowerCase();
                        return a > b ? 1 : (a < b ? -1 : 0);
                });
Reply
#27
You should submit your finished code changes as a PR so I can test them.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#28
(09-14-2020, 10:02 PM)Tim Curtis Wrote: You should submit your finished code changes as a PR so I can test them.

Ok, I submitted a pull request. It should be against tag r671prod but when I selected a tag on github the comment and submit box disappeared leaving me with no way to submit the pull request. I guess they're not allowed against tags.
Reply


Forum Jump: