Skip to content

Extended M3U Playlists: Reading song metadata from MPD's name tag.#103

Open
tkapias wants to merge 1 commit into
boysetsfrog:masterfrom
tkapias:master
Open

Extended M3U Playlists: Reading song metadata from MPD's name tag.#103
tkapias wants to merge 1 commit into
boysetsfrog:masterfrom
tkapias:master

Conversation

@tkapias

@tkapias tkapias commented Apr 2, 2023

Copy link
Copy Markdown

This Pull Request is just an updated copy of @Rio6's PR #93 and related to issue #63.

  • I just updated the place of @Rio6's PR modifications in the current master and the name of %N to %P.
  • I am not sure of the impact of the change in some conditions from && to || like commented by @Rio6 in his PR, it needs some review.
  • It does not cover all the places where vimpc could use the metadata from the playlist comments, but the most visible ones.
  • It works fine for me.

Introduction

My mpd.conf contains the following definitions:

playlist_directory              "~/.config/mpd/playlists"

playlist_plugin {
    name "extm3u"
    enabled "true"                                              
}

In the playlist_directory I have some playlist files in Extended M3U format.

  • Example of UTF-8 Extended M3U file content with one web radio stream and one mp3 file (~/.config/mpd/test.m3u):
#EXTM3U
#EXTENC:UTF-8
#PLAYLIST:Test
#EXTINF:-1,Sud Radio - Web radio
#EXTART:Sud Radio
#EXTGRP:STREAMS
https://ice.creacast.com/sudradio
#EXTINF:-1,Lady Pank - Zamki na piasku
#EXTART:Lady Pank
#EXTGRP:MP3
/home/user/Music/Lady Pank/Lady Pank - Lady Pank/07 - Zamki na piasku.mp3
  • Only the #EXTM3U, #EXTINF and the URL or filepath are of interest for this PR.

But, vimpc does not fetch the information from EXTINF even if MPD does provide it.

  • In the "playlist" tab:
    • The lines linked to a stream is just named with the URL. It does not change when playing.
    • The line linked to an mp3 file is described correctly with metadatas.
    • The 'e' key for information does not work for lines with streams.
  • In the Status line:
    • When the stream is launching, it displays the URL, and then the metadata fetched from the stream.
    • If it misses some information from the stream like the artist name, it displays "Unknown - ".
  • In the "list" tab:
    • The 'e' key for information open a tab for the list, but only the files are described, stream lines are missing.

Solution

This PR introduces 2 new tags (name and comment) and modify the songformat.

Differences after this PR:

  • In the "playlist" tab:
    • The lines linked to a stream are named as the EXTINF. It's updated from the stream when playing.
    • The line linked to an mp3 file is described correctly with metadatas, not from EXTINF.
    • The 'e' key for information still does not work for lines with streams.
  • In the Status line:
    • When the stream is launching it displays the EXTINF name, and then the metadata fetched from the stream.
    • If it misses some information from the stream like the artist name, it still displays "Unknown - " and does not use informations from EXTINF.
  • In the "list" tab:
    • The 'e' key for information open a tab for the list, but still only the files are described, stream lines are missing.

@tkapias

tkapias commented Apr 2, 2023

Copy link
Copy Markdown
Author

I named it "Extended M3U Playlists" as in my example and my own usage, but it should work with other playlists formats fetched by MPD because vimpc get's the data from MPD.

@tkapias

tkapias commented Apr 2, 2023

Copy link
Copy Markdown
Author

I have noted 2 more detail to improve after PR:

  • In the "playlist" tab:
    • The lines linked to a stream are named as the EXTINF. When playing, if there is no data from the stream the line switch to the URL or the filename part of the URL.
  • In the Status line:
    • When the stream is launching it displays the EXTINF name, When playing, if there is no data from the stream the line switch to the URL or the filename part of the URL.

But it's still better than without PR.

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.

1 participant