Is there a way to spoof the date metadata on folders?

0

I have a collection of CreativeCommons music on a USB, that I used a digital TV to listen to, but its default media player is a bit limited. It offers only two list orders (data and alphabetic), which can only be set universally (not per view), and apply to both folders and files. It also fails to pull track number metadata from files, and if I want any chance of listening to an album in the correct track order, I have to choose date order. But this then makes it really hard to search through the album list, without constantly toggling back and forth between date and alphabetic order.

Is there a way to spoof the date metadata on the album folders, so they reflect the year the album was released? For example, for an album released in 2015, the folder would tell the media player it was created in 2015.

EDIT: I'm using GNU-Linux, and ideally looking for a command I can use in a terminal, or tips on how to write a simple Bash script, to do the whole collection in one go.

strypey

Posted 2018-06-07T06:38:26.380

Reputation: 1

Seems duplicate of this. Also, if album is released in 2015 then you can pre-fix year in album name. <Year>_<AlbumName>

– Sandeep – 2018-06-07T07:07:00.150

Thanks for the link, but I'm using GNU-Linux, not Windows, so not a duplicate. I'll add this detail to the question. Also, I prefer not to change the folder title format for my portable collection, just to work with the one device this creates issues with (I prefer to use artist-year-album to group artists together, and the TV has no internal storage where I could change them just for that). Creative suggestion though :) – strypey – 2018-06-07T15:24:47.427

Answers

0

touch takes a -d argument that supports specifying the date of interest.

touch -d "2015-04-20" somefolder

Ignacio Vazquez-Abrams

Posted 2018-06-07T06:38:26.380

Reputation: 100 516

That's the kind of command I'm looking for, thanks. touch -d "2015" albumfolder would do nicely for one album. I'm imagining a Bash script would be the way to run this through my whole collection (many album folders, all in one music folder). Any advice on how to get the script to take the year from the folder name (artist-year-albumname), and do the touch -d with it, for each folder? – strypey – 2018-06-07T17:03:36.410

http://tldp.org/LDP/abs/html/parameter-substitution.html – Ignacio Vazquez-Abrams – 2018-06-07T17:29:03.330

Thanks for this, it looks like a great resource. But the title of this page is "Advanced Bash-Scripting Guide" and it's all Geek to me. I'm a total beginner at bash scripting. Does anyone know of a more newbie friendly equivalent? – strypey – 2018-06-07T19:27:14.760