Skip to content

Conversation

@Oowoosh0
Copy link
Contributor

@Oowoosh0 Oowoosh0 commented Mar 17, 2025

Fixes #693
Fixes #775
Closes #697

  • Metadata discovery is handled when a new AudioObject is created.
  • The discovery is delegated to a MetadataDiscoverer to avoid creating a new gstreamer discoverer for every AudioObject and to map the returned metadata back to the corresponding AudioObjects.
  • This also fixes a bug where adding the same file multiple times led metadata not being updated for that file.

@danirabbit

This comment was marked as resolved.

@Oowoosh0 Oowoosh0 force-pushed the metadata-in-audioobject branch from cd1839c to afd600b Compare March 20, 2025 15:56
@Oowoosh0

This comment was marked as resolved.

@zeebok

This comment was marked as resolved.

Copy link
Member

@danirabbit danirabbit left a comment

Choose a reason for hiding this comment

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

Definitely cleans up the PlaybackManager. Adding a MetadataDiscoverer singleton makes sense to me. Just one question

Comment on lines +25 to +52
public void update_metadata (Gst.PbUtils.DiscovererInfo info) {
duration = (int64) info.get_duration ();

unowned Gst.TagList? tag_list = info.get_tags ();

string _title;
tag_list.get_string (Gst.Tags.TITLE, out _title);
if (_title != null) {
title = _title;
}

string _artist;
tag_list.get_string (Gst.Tags.ARTIST, out _artist);
if (_artist != null) {
artist = _artist;
} else if (_title != null) { // Don't set artist for files without tags
artist = _("Unknown");
}

var sample = get_cover_sample (tag_list);
if (sample != null) {
var buffer = sample.get_buffer ();

if (buffer != null) {
texture = Gdk.Texture.for_pixbuf (get_pixbuf_from_buffer (buffer));
}
}
}
Copy link
Member

Choose a reason for hiding this comment

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

These properties are all publicly settable so why do this here instead of in the MetadataDiscoverer?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes this probably should be moved into the MetadataDiscoverer. Sorry I didn't have much time the last 2 weeks, but I'll have a lot more time from wednesday onward to update this.

@zeebok
Copy link
Contributor

zeebok commented Jun 4, 2025

New conflict to resolve @Oowoosh0

@danirabbit danirabbit mentioned this pull request Aug 13, 2025
3 tasks
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.

Re-adding a file causes a partially corrupt queue item Move Metadata Discoverer to AudioObject?

3 participants