Skip to content

api/soundcloud: add more metadata support #1313

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

nexpid
Copy link

@nexpid nexpid commented Jun 2, 2025

this PR adds and documents the composer, genre and album_artist metadata tags. it also adds more metadata parsing to the soundcloud service:

  • album
  • album_artist
  • composer
  • genre
  • date
  • copyright

why?

having more metadata is always nice. this is a comparison with onthespot in foobar2000

onthespot develop feat/more-metadata
foobar2000_zfKvABMRfN foobar2000_ZNfxyQ3R1x foobar2000_ohvvmuCuLl

PS: invest in a formatter. please

@nexpid
Copy link
Author

nexpid commented Jun 2, 2025

couldn't find a track with a composer but i pinky promise it gets parsed properly. here's another track which also has a genre specified:
image
soundcloud sadly (to my knowledge) doesn't tell you the track number of a song

Copy link
Member

@wukko wukko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add more optional chaining operators (?.), because else an error will be thrown instead of an empty metadata field

title: json.title.trim(),
artist: json.user.username.trim(),
title,
album: json.publisher_metadata.album_title?.trim() ?? title,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't think the fall back to song title makes sense here, wouldn't it be misleading most of the time?

album_artist: artist,
composer: json.publisher_metadata.writer_composer?.trim(),
genre: json.genre.trim(),
date: json.display_date.slice(0, 4),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is the date sliced here in such a way?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it only keeps the release year, not the full date (which is what onthespot does)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

during research I also found this gist, which lists the date as just the year, https://gist.github.com/eyecatchup/0757b3d8b989fe433979db2ea7d95a01

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cobalt keeps the full date for songs from youtube music, so i think it should be this way here too

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ffmpeg should be able to write the full date into the TDRC tag supported in id3v2.4:
https://github.com/FFmpeg/FFmpeg/blob/a5103808f440323109304045fe012f881c36e6c1/libavformat/id3v2.c#L66-L67

@wukko
Copy link
Member

wukko commented Jun 3, 2025

couldn't find a track with a composer

if you can't find it, then it's probably not there. i wouldn't add something you're not sure in existence of. you can always add it later!

@nexpid
Copy link
Author

nexpid commented Jun 3, 2025

if you can't find it, then it's probably not there

turns out I just didn't look hard enough, this song by Imogen Heap has proper credits

{
	"id": 1978104099,
	"urn": "soundcloud:tracks:1978104099",
	"artist": "Imogen Heap",
    // ........
	"writer_composer": "Imogen Heap, Guy Sigsworth",
	"release_title": "Let Go (on the hang in the park)"
}

@nexpid nexpid requested a review from wukko June 3, 2025 17:43
@nexpid nexpid force-pushed the feat/more-metadata branch from 0afa2b1 to 88e8b52 Compare June 3, 2025 17:44
@nexpid
Copy link
Author

nexpid commented Jun 5, 2025

@wukko reminder to review again pls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants