Skip to main content

Linky - the symlink tagger

It's been a while I've been unsatisfied how my media collection is organized. Once a windows user, I bounced around a few music players and managers like WinAmp, Windows Media Player, iTunes, Media Jukebox and few cross platform players like Clementine, Amarok, and a others whose names I can't remember. Every switch has been painful. Play counts, ratings, genres, and many other tags are stored and read differently.

For videos, it's worse. Some containers seemingly have no tags or the tags aren't used, so people came up with naming schemes for everything. And of course the naming schemes differ - sometimes wildly. Unfortunately, media library software has the burden of trying to parse these names for meta-data to query servers with in order to get cover art, actors, chapters, etc. Some, bless their hearts, actually allow scripts in order to help tech savvy users customize how and where this info is retrieved.

The major downside however is that every one of these solutions stores their data in a database of some sort that is incompatible with other software and with no documentation or method of migration, should you switch.

Wat do?

Being a long-time linux user (more than a decade now), I enjoy the concept in Linux that everything is a file. Files are everywhere and they are used A LOT, so lots of conventions exist on where to put stuff and how things are named.

🤔

Why not just use folders to organize everything? Create a directory per artist, per rating, per genre, per whatever and simply put the media file in each - oh wait... that means create a copy of a file in each directory...

Symlinks to the rescue

Basically, symlinks are pointers/links/references, very similar to hyperlinks but on the filesystem. They simply point/link/reference another existing file.

You might already see where I'm getting with this. Instead of copying the media file into each folder, one simply creates a symlink from the folder to the media file.

weSmart4

Now all that's needed is software to manage all that monkaEyes1

Enter linky

linky is the attempt at managing all that.

After initializing a folder, all the files are moved into a hidden a data/base folder within the initial folder and the directory structure is recreated therein too. Where the files once were, symlinks will now exist - all pointing to the real files in the base folder - while the directories stay intact. The initialized directory is now called a linked root.

Within the linked root, it will now be possible to start categorizing and tagging files and folders. This is done simply by having a convention <linked root>/<category>/<tag>/thing/to/tag.ext.

Examples:

  • /Rating/1/Lucius Malfoy/The Death Choir/1 - The Dark Lord Diddled Me.mp3
  • /Artist/Greg Martin/Universal Silence.jpg
  • /Genre/SciFi/Evolution.1080p.YIFY.mp4

Pros and Cons

Pros:

  • A file can be linked in multiple folders
  • Manually manageable
    Basically everything can be done manually with simple commands
  • Can live across file systems
  • Backups will keep the folder structure

Cons:

  • Manually managing is possible but tedious
  • Lots of code to write 😅

An attempt at more in depth documentation is in the repository as well as more examples.

At the moment there's no stable version, but v1 is in the works.