Skip to content
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

Some fixes and enhancements about cue files in satellite setup #1780

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Commits on Aug 16, 2023

  1. SongPrint: include real_uri in song_print_info

    CUE virtual playlists is currently implemented by accessing ranges in
    file referenced by `real_uri` locally. But the `real_uri` is not
    included in the song info protocol, thus `ProxyDatabasePlugin` is not
    able to retreive this information and access the corresponding file,
    leads to not working cue tracks in satellite setup.
    
    This commit adds the `real_uri` field into server-printed song info,
    with the key name `RealUri`.
    datasone committed Aug 16, 2023
    Configuration menu
    Copy the full SHA
    48bdcd1 View commit details
    Browse the repository at this point in the history
  2. db/ProxyDatabasePlugin: read real_uri from server's song info

    This commit reads `real_uri` property from `mpd_song` in libmpdclient,
    and set ProxySong's `real_uri` base on it. The commit solves the issue
    that cue virtual playlists not working in satellite setup.
    datasone committed Aug 16, 2023
    Configuration menu
    Copy the full SHA
    32fbdb7 View commit details
    Browse the repository at this point in the history
  3. input/CurlInputPlugin: fix malformed value for HTTP Range header

    CURLOPT_RANGE value requires the format "X-Y", where X or Y can be
    omitted. The current value provided to libcurl in `CurlInputPlugin` is
    only offset without the hyphen character and will cause HTTP error while
    accessing song files with range. This commit fixes it by adding back the
    hyphen and feed value formatted by `{offset}-` to libcurl.
    datasone committed Aug 16, 2023
    Configuration menu
    Copy the full SHA
    495f453 View commit details
    Browse the repository at this point in the history
  4. db/ProxyDatabasePlugin: read millisecond values for range start and end

    Range `start` and `end` values in `mpd_song` (libmpdclient) is stored in
    seconds only, which makes range times in `ProxySong` truncated to
    seconds and leads to precision loss on satellite cue track range times.
    
    This commit reads the added `start_ms` and `end_ms` value from
    libmpdclient, which represent range start and end time in milliseconds.
    And uses them to set `start_time` and `end_time` of `ProxySong`.
    datasone committed Aug 16, 2023
    Configuration menu
    Copy the full SHA
    0f7ee06 View commit details
    Browse the repository at this point in the history
  5. player/Thread: merge tag for songs have range instead of replacing wi…

    …th `chunk->tag`
    
    While playing first track of cue file on satellite setup, the tag of
    currentsong will loss. This is due to `chunk->tag` overwriting song tag
    in `PlayerControl::PlayChunk`. In local cue files, `song_tag` is used to
    form `stream_tag` and merged into `chunk->tag`, but `song_tag` only
    works for local files. So the `chunk->tag` is decided by decoded tag
    from audio files, which in cue's case is the whole album file and
    doesn't contain track metadata.
    
    This commit fixes the issue by merging song's tag with `chunk->tag`
    (with `chunk->tag` prioritized) in `PlayerControl::LockUpdateSongTag`,
    only when the song's `end_time` is not zero. As the `end_time` will
    only be set on cue virtual songs or with `rangeid` command, i.e. songs
    represented by portion of a whole file, where metadata of the portion
    and whole file may differ. The impact to current behaviour is minimized:
    changes only happen when users use `rangeid` command on a remote song,
    and they expect that song tags in database should be completely
    overwritten with tags provided by remote stream instead of merged.
    datasone committed Aug 16, 2023
    Configuration menu
    Copy the full SHA
    630d68d View commit details
    Browse the repository at this point in the history