Add uguu.se artwork upload for private Navidrome instances (#4)

This commit is contained in:
Deluan Quintão
2026-02-07 14:27:32 -05:00
committed by GitHub
parent e84a89809e
commit 758759cda0
9 changed files with 269 additions and 37 deletions

17
main.go
View File

@@ -91,21 +91,6 @@ func getConfig() (clientID string, users map[string]string, err error) {
return clientID, users, nil
}
// getImageURL retrieves the track artwork URL.
func getImageURL(trackID string) string {
artworkURL, err := host.ArtworkGetTrackUrl(trackID, 300)
if err != nil {
pdk.Log(pdk.LogWarn, fmt.Sprintf("Failed to get artwork URL: %v", err))
return ""
}
// Don't use localhost URLs
if strings.HasPrefix(artworkURL, "http://localhost") {
return ""
}
return artworkURL
}
// ============================================================================
// Scrobbler Implementation
// ============================================================================
@@ -163,7 +148,7 @@ func (p *discordPlugin) NowPlaying(input scrobbler.NowPlayingRequest) error {
End: endTime,
},
Assets: activityAssets{
LargeImage: getImageURL(input.Track.ID),
LargeImage: getImageURL(input.Username, input.Track.ID),
LargeText: input.Track.Album,
},
}); err != nil {