• Undearius@lemmy.ca
    link
    fedilink
    arrow-up
    3
    ·
    edit-2
    11 months ago

    I do something very similar. I have all my music on a network share with a playlist folder inside. I run a script that copies all the lines from an .m3u playlist file and copies them to another music folder inside my user folder, converting any FLAC files along the way.

    I then user SyncThing to synchronize that folder with my phone. Makes it super easy to get all my music and playlists when I upgrade to a new phone.

    a = *lines from playlist file*
    new = *destinationFolder*
    # If the mp3 version of the flac is older than the flac or doesn't exist in the destination,
    # convert it from Flac to variable bitrate mp3
      if [ "$a" -nt "${new[@]/%flac/mp3}" ]; then
        echo Converting $a
        ffmpeg -y -i "$a" -qscale:a 0 "${new[@]/%flac/mp3}"
      fi
    

    There’s some cleaning and other steps done but I’m willing to share or provide more details if anyone is interested.

    • Willer@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      11 months ago

      Its a shame that you NEED a secondary lossy archive. You can only do true on-the-fly functionality when the syncing and music app are not seperate. Currently i use MusicBee for the transcoding and resilio for the syncing. I should propably switch over to syncthing too tho.

      • Undearius@lemmy.ca
        link
        fedilink
        arrow-up
        2
        ·
        edit-2
        11 months ago

        I have several terabytes of free space on my server so I have no issue sacrificing a few gigs to have the lossy archive be portable and independent of the music software.

        It gives me the freedom to drop the lossy archive to whatever device I want (SyncThing to make it automatic and wireless) and use whatever music play I choose.

        I could, and have thought about, switching the script to use hardlinks for the MP3s which means the only storage used is for the transcoded MP3s. Plus it would get rid of the requirement to sync any updated MP3s from the original archive to the lossy one, the hardlinks would just update with the original.

        • Willer@lemmy.world
          link
          fedilink
          arrow-up
          1
          ·
          11 months ago

          I think musicbee had a plugin that could do that, havnt had any quick success with it.