[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/wsr/ - Worksafe Requests

Name
Options
Comment
Verification
4chan Pass users can bypass this verification. [Learn More] [Login]
File
  • Please read the Rules and FAQ before posting.

08/21/20New boards added: /vrpg/, /vmg/, /vst/ and /vm/
05/04/17New trial board added: /bant/ - International/Random
10/04/16New board for 4chan Pass users: /vip/ - Very Important Posts
[Hide] [Show All]


[Advertise on 4chan]


I have a audio player that sorts files by creation / modification date, so i need the creation date to match the track number for the album to play in proper order. Pic rel is one folder where the date is the same on every file, but i need some some kind of program that can modify these so file 01 has the earliest date and then it grows with every with every next file. I'm using Linux mInt
>>
>>1564568
You could probably do that with a python script, ask chatgpt
>>
>>1564568
I think Bulk Rename Utility can do this...?
>>1564573
>ask chatgpt
Bot response
>>
>>1564568
literally just "touch", the command line utility
>>
Metamorphose. This is a super powerful utility.

And you can try and press on the words Origin and Renamed to modify sort order. Might work. Might not.
>>
>>1564568
Have you considered using a less shitty audio player?
>>
#!/bin/bash
# fix_track_timestamps.sh
# Sets file modification/access times so files sort in filename order.
# Each file gets a timestamp 1 minute apart, starting from a base date.
#
# Usage:
# ./fix_track_timestamps.sh /path/to/album/folder
# ./fix_track_timestamps.sh <- uses current directory

TARGET_DIR="${1:-.}"

# Base timestamp: change this if you want a different starting point
BASE_DATE="2000-01-01 00:00:00"

# Audio file extensions to process (add more if needed)
EXTENSIONS="mp3|flac|ogg|wav|aac|m4a|wma|opus|ape|mpc|aiff|alac"

echo "=== Track Timestamp Fixer ==="
echo "Folder : $TARGET_DIR"
echo "Base : $BASE_DATE"
echo ""

# Collect and sort matching files by filename (natural sort handles 01, 02 ... 10, 11 correctly)
mapfile -t FILES < <(find "$TARGET_DIR" -maxdepth 1 -type f \
| grep -iE "\.($EXTENSIONS)$" \
| sort -V)

if [ ${#FILES[@]} -eq 0 ]; then
echo "No audio files found in '$TARGET_DIR'."
exit 1
fi

echo "Found ${#FILES[@]} file(s). Applying timestamps..."
echo ""

# Convert base date to Unix epoch seconds
BASE_EPOCH=$(date -d "$BASE_DATE" +%s)
INTERVAL=60 # seconds between each file (1 minute)

for i in "${!FILES[@]}"; do
FILE="${FILES[$i]}"
BASENAME=$(basename "$FILE")
NEW_EPOCH=$(( BASE_EPOCH + i * INTERVAL ))
NEW_STAMP=$(date -d "@$NEW_EPOCH" +"%Y%m%d%H%M.%S") # format for 'touch'
NEW_HUMAN=$(date -d "@$NEW_EPOCH" +"%Y-%m-%d %H:%M:%S")

# -t sets both access and modification time; no creation time on Linux ext4
touch -t "$NEW_STAMP" "$FILE"

printf " [%02d] %-45s -> %s\n" "$((i+1))" "$BASENAME" "$NEW_HUMAN"
done

echo ""
echo "Done! All timestamps updated."
echo ""
echo "TIP: On Linux, 'creation time' (birth time) is not reliably settable."
echo "Most players sort by *modification* time, which this script updates."
echo "If your player uses birth time, see the notes in the README below."
>>
>>1564568
exiftool
You'll have to look it up because I'm not an expert.

You'll want to use a substring of the first two characters from the filename and write to the CreateDate. If the program sorts by time not just the day date then you can write to the seconds or minutes, and with more files than days per months or seconds per minute you can use a variable to increment the month or minute while decrementing integer value of the filename's first two characters back to 00 or 01
>>
>>1564605
Thanks, seems like this could work. Might just need some time to figure this stuff out



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.