Skip to main content

Movie Update TimeStamp to Theatrical Release Date

pknw1logo-white.png

/usr/local/bin/releaseDate


Movie File Date/Time modifier

Reads the selected movie theatrical release date from previously stored metadata and sets the movie date and time to the release date so that it displays orderly in Plex


#!/bin/bash
# set releaseDate 

TS=$(cat "${1}" | jq '.releaseDate' | sed 's/"//g' | awk -FT '{print $1}' | awk -F- '{print $1$2$3}')0000.00
FOLDER=$(dirname "${1}")
if [ "${TS}" == "0000.00" ] || [ "${TS}" == "null0000.00" ]
then 
	echo "${FOLDER} invalid"
else
	echo "${TS} ${FOLDER}" || echo "${FOLDER} invalid"
	touch -a -m -t "${TS}" "${FOLDER}" || "${FOLDER} invalid"
	touch -a -m -t "${TS}" "${FOLDER}"/* || "${FOLDER} invalid"
fi

execution

  • ensure the movie has been scraped
  • requires <movie-name>.nfo to exist
  • parses nfo for release date
  • updates the file timestamp

further info


Product Home

Link

Documentation

Link

Github

Link

DockerHub

Link

Misc

Link

more text more text