From b4bac1345f1d9a739db3bdc5a2f97654ac57cfcc Mon Sep 17 00:00:00 2001 From: Vishal Rao Date: Sun, 22 May 2022 03:23:38 +0530 Subject: [PATCH] Use file basename instead of uri for the default audio object title. --- src/PlaybackManager.vala | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/PlaybackManager.vala b/src/PlaybackManager.vala index 4b842c172..3072cf072 100644 --- a/src/PlaybackManager.vala +++ b/src/PlaybackManager.vala @@ -81,7 +81,14 @@ public class Music.PlaybackManager : Object { foreach (unowned var file in files) { if (file.query_exists ()) { var audio_object = new AudioObject (file.get_uri ()); - audio_object.title = audio_object.uri; + + string? basename = file.get_basename (); + + if (basename != null) { + audio_object.title = basename; + } else { + audio_object.title = audio_object.uri; + } discoverer.discover_uri_async (audio_object.uri);