{queue,song}_print: print relative paths if possible
If a song with an absolute path points inside the music directory, print only the relative part. This happens when partial songs from a playlist file were loaded.
This commit is contained in:
10
src/mapper.c
10
src/mapper.c
@@ -93,6 +93,16 @@ mapper_has_music_directory(void)
|
||||
return music_dir != NULL;
|
||||
}
|
||||
|
||||
const char *
|
||||
map_to_relative_path(const char *path_utf8)
|
||||
{
|
||||
return music_dir != NULL &&
|
||||
memcmp(path_utf8, music_dir, music_dir_length) == 0 &&
|
||||
G_IS_DIR_SEPARATOR(path_utf8[music_dir_length])
|
||||
? path_utf8 + music_dir_length + 1
|
||||
: path_utf8;
|
||||
}
|
||||
|
||||
char *
|
||||
map_uri_fs(const char *uri)
|
||||
{
|
||||
|
Reference in New Issue
Block a user