diff --git a/go_backend/amazon.go b/go_backend/amazon.go index 7597d324..012d8c58 100644 --- a/go_backend/amazon.go +++ b/go_backend/amazon.go @@ -36,46 +36,6 @@ type AfkarXYZResponse struct { } `json:"data"` } -func amazonArtistsMatch(expectedArtist, foundArtist string) bool { - normExpected := strings.ToLower(strings.TrimSpace(expectedArtist)) - normFound := strings.ToLower(strings.TrimSpace(foundArtist)) - - if normExpected == normFound { - return true - } - - if strings.Contains(normExpected, normFound) || strings.Contains(normFound, normExpected) { - return true - } - - expectedFirst := strings.Split(normExpected, ",")[0] - expectedFirst = strings.Split(expectedFirst, " feat")[0] - expectedFirst = strings.Split(expectedFirst, " ft.")[0] - expectedFirst = strings.TrimSpace(expectedFirst) - - foundFirst := strings.Split(normFound, ",")[0] - foundFirst = strings.Split(foundFirst, " feat")[0] - foundFirst = strings.Split(foundFirst, " ft.")[0] - foundFirst = strings.TrimSpace(foundFirst) - - if expectedFirst == foundFirst { - return true - } - - if strings.Contains(expectedFirst, foundFirst) || strings.Contains(foundFirst, expectedFirst) { - return true - } - - expectedASCII := amazonIsASCIIString(expectedArtist) - foundASCII := amazonIsASCIIString(foundArtist) - if expectedASCII != foundASCII { - GoLog("[Amazon] Artist names in different scripts, assuming match: '%s' vs '%s'\n", expectedArtist, foundArtist) - return true - } - - return false -} - func amazonIsASCIIString(s string) bool { for _, r := range s { if r > 127 { diff --git a/go_backend/deezer.go b/go_backend/deezer.go index 38a583d9..c8ecc229 100644 --- a/go_backend/deezer.go +++ b/go_backend/deezer.go @@ -1010,10 +1010,7 @@ func (c *DeezerClient) GetExtendedMetadataByISRC(ctx context.Context, isrc strin } // SpotifyID contains "deezer:123" format, extract the ID - deezerID := track.SpotifyID - if strings.HasPrefix(deezerID, "deezer:") { - deezerID = strings.TrimPrefix(deezerID, "deezer:") - } + deezerID := strings.TrimPrefix(track.SpotifyID, "deezer:") if deezerID == "" { return nil, fmt.Errorf("track found but no Deezer ID") diff --git a/go_backend/metadata.go b/go_backend/metadata.go index f2dac03d..2cc90473 100644 --- a/go_backend/metadata.go +++ b/go_backend/metadata.go @@ -682,21 +682,6 @@ func EmbedM4AMetadata(filePath string, metadata Metadata, coverData []byte) erro return nil } -func findAtom(data []byte, name string, offset int) int { - for i := offset; i < len(data)-8; { - size := int(uint32(data[i])<<24 | uint32(data[i+1])<<16 | uint32(data[i+2])<<8 | uint32(data[i+3])) - if size < 8 { - break - } - atomName := string(data[i+4 : i+8]) - if atomName == name { - return i - } - i += size - } - return -1 -} - // buildMetaAtom builds a complete meta atom with ilst containing metadata func buildMetaAtom(metadata Metadata, coverData []byte) []byte { var ilst []byte diff --git a/lib/providers/recent_access_provider.dart b/lib/providers/recent_access_provider.dart index 0070cc95..e0475aef 100644 --- a/lib/providers/recent_access_provider.dart +++ b/lib/providers/recent_access_provider.dart @@ -122,7 +122,8 @@ class RecentAccessNotifier extends Notifier { items = decoded .map((e) => RecentAccessItem.fromJson(e as Map)) .toList(); - } catch (e) { + } catch (_) { + // Ignore JSON parse errors, use empty list } }