feat: Tags!!#707
Conversation
…g for a song when available in the ui
BLeeEZ
left a comment
There was a problem hiding this comment.
Hi,
First of all thank you for this PR.
It is always beneficial to store as much information as available for better database search and user experience.
There are two major points that needs to be matched:
- Albums artists, artists, genres: all these attributes need to be linked to their DB entity not just string. This is needed to be available for searches and sorting.
- The Ampache API needs to be supported as well.
| persist() | ||
| } | ||
|
|
||
| private func persist() { |
There was a problem hiding this comment.
No direct UserDefaults access. Use User Settings that save it.
| COPY_PHASE_STRIP = NO; | ||
| DEBUG_INFORMATION_FORMAT = dwarf; | ||
| DEVELOPMENT_TEAM = U3R6D65S8W; | ||
| DEVELOPMENT_TEAM = 8N5BD6J6TY; |
There was a problem hiding this comment.
Remove adjusted DEVELOPMENT_TEAM.
| "episode", songBuffer != nil { | ||
| // Multi-artist display string | ||
| if !collectedArtistNames.isEmpty { | ||
| songBuffer?.artistsString = collectedArtistNames.joined(separator: ", ") |
There was a problem hiding this comment.
why is it save as a String and not referencing the element directly as array. This would improve DB search.
| set { managedObject.artistsString = newValue } | ||
| } | ||
|
|
||
| public var albumArtistsString: String? { |
| set { managedObject.channelCount = newValue } | ||
| } | ||
|
|
||
| public var samplingRate: Int32 { |
There was a problem hiding this comment.
Should only be Int. The wrapper is there to hide the actual size of the DB entry.
Sounds good I will get an update pushed out as soon as possible! :) |
|
|
oops forgot to run tests. Fix for the tests out in a bit |
|
Finally fixed the tests! @BLeeEZ Sorry for the delay. Summary of changes made: AmperfyKit/Api/Ampache/IDsParserDelegate.swift:53 — Added "albumartist" to the element name case so the ID parser now collects albumartist IDs into prefetchIDs.artistIDs. This prevents duplicate artist creation across re-parses. AmperfyKitTests/Cases/API/Ampache/PlaylistSongsParserTest.swift:133 — Updated artistCount from 4 to 5 to account for the albumartist "19" now being counted. AmperfyKitTests/Cases/API/Ampache/SongParserTest.swift:44 — Updated artistCount from 4 to 5 for the same reason (same XML structure includes ). |
|
@BLeeEZ let me know if I need to make any more changes to this PR. Would love to see this in the app if possible :) |
|
@bmcwilliams96 this is a huge PR and I am currently quite limited with time that I can spend on this App. There a lot of topics that don't match Amperfy's software architecture and code style. It would need a deeper look of myself to get everything aligned. |
|
@BLeeEZ Fully understood! I will also take a deeper look and try to make some more improvements. I just recently started a test Ampache server to help with testing. This way I can get you a better quality PR to review when you are ready. Thanks for all you do :) |
Tag Viewer
Adds a new "View Tags" page accessible from the context menu of each song. This page is only accessible if the given song has tags. Otherwise, the option will not show up.
By default, all tags will show, but the user has the option to filter which tags they want shown. This setting will be persistent amongst songs in the library. If a tag that has not been seen before is present in a song, it will be added to the filter list, and shown by default.
This gives the user an opportunity to have an info screen about the song they are listening to. The main use case would be for a "song credits" type screen, but it is up to the user how they want to use this page.
This new page is only present in-app and is not available in CarPlay.
Artists Tag
In addition to this change, there is also an adjustment to show the "Artists" tag as the artist for a song. Previously, we were only grabbing the first artist available, so a song by Thundercat and Tame Impala would just show "Thundercat". Now, it will show both, separated by a comma.
If the Artists tag is not available, it will fall back to the original parsing we were doing before.
This new comma separated artist shows up in all views (CarPlay, system now playing, song list, and in-app now playing)
Tests
A new test was also added for the new tag viewer page.