Is there a useful utility for managing multiple "alternatives" of a given file?
0
votes
0
answers
38
views
The example I'm going to give here is a simple media file conundrum.
In this example, say I have multiple versions of a given audio file:
SomeSongLibrary/
awesome-song-compressed.mp3
awesome-song-lossless.flac
awesome-song-raw-project-file.binaryblob
I also have a media playing application (e.g. Jellyfin, or Quodlibet, etc.) that is really only interested in one of these files at a given point in time. For example, Jellyfin has no ability to glob ignore specific files, so our given awesome song will show up twice (assuming it doesn't also grab that binaryblob by mistake, which can occur I've found!).
That's where my issues begin and the desire to manage multiple "forks" of an individual file begin to show themselves.
So the question becomes what are the means to solving this problem in a user-friendly way (cli is accepted)?
The easiest but clumsiest way I found to solve this problem is to use a hidden folder with symlinks to the real content -- but obviously the file extension wouldn't be able to match the desired link. This example would look like:
SomeSongLibrary/
awesome-song-link # symlink, points to files inside swap
.awesome-song-swap/
awesome-song-compressed.mp3
awesome-song-lossless.flac
awesome-song-raw-project-file.binaryblob
This is obviously error prone without a utility application, as for every file you'd need to make proper links. Additionally, you have to really hope that the given unix application is not at all dependent on the file extension to determine filetype (I would hope this is the case, but you cannot guarantee it) and also that the application is smart enough to skip hidden folders during the media scanning process.
The next solution I thought of was using a git project for each of these folders with forks for each collection of filetypes or content. So you would make a git repo for SomeSongLibrary
, create a branch in SomeSongLibrary
for each of the types of files (mp3
, flac
, etc.) and then switch between those forks when you want access to different versions of a given file.
This is great in theory, but also terrible since git doesn't really love dealing with binary files. While the cost of the binary files isn't much worse than just having multiple copies at the first place, this is not the case when you consider files that change (e.g. tags of awesome-song-compressed.mp3
being updated.) Additionally, I don't really need all the cruft associated with a full versioning system. Lastly, it would be nice to manage individual files in a folder, not the whole folder at once (so different files can be different versions.)
So it might be a long shot, but has anyone ever had a problem like this and come up with a clever solution (script or full blown application?) Additionally, is this even a good idea or does it go against unix/posix file system standards?
Asked by TheYokai
(143 rep)
Jan 9, 2023, 10:48 PM