Date Added Change To Date Created In Jellyfin

Support for Synology NAS, QNAP NAS and other Embedded Linux systems
Post Reply
Stewart
Posts: 20
Joined: 08 May 2024, 06:44

Date Added Change To Date Created In Jellyfin

Post by Stewart »

Stewart wrote:27 Sep 2025, 15:37 Hi Rednoah
Can filebot change file created metadata to match release date in jellyfin?

Thanks in advance

Stewar
rednoah wrote:27 Sep 2025, 16:36 I think you mean to set the Last-Modified and Creation-Date to the episode airdate / movie release date. The Set creation date feature will do just that.

PS: Please create a public thread if possible.

Hi rednoah

where do I put "--apply date" in filebot?

Thanks

Stewart
User avatar
rednoah
The Source
Posts: 24169
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Date Added Change To Date Created In Jellyfin

Post by rednoah »

rednoah wrote: 14 Sep 2019, 20:35 Post-processing features can be enabled for newly renamed files via Icon Renaming SettingsIcon Post Process.

ScreenshotScreenshot

:arrow: If you're using the Desktop application, then you can enable the Set creation date feature via Icon Renaming SettingsIcon Post Process and ticking the Set creation date item.
:idea: Please read the FAQ and How to Request Help.
Stewart
Posts: 20
Joined: 08 May 2024, 06:44

Re: Date Added Change To Date Created In Jellyfin

Post by Stewart »

Hi rednoah

Do i have to rename again with jellyfin preset and tick set creation date in post proccessing to change date added in jellyfin?

Thanks

Stewart
User avatar
rednoah
The Source
Posts: 24169
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Date Added Change To Date Created In Jellyfin

Post by rednoah »

Assuming that files have been renamed with FileBot, and thus have xattr metadata readily available, Apply Post-Processing Features via Filter can be used to run the Set creation date at any time on a selected set of files.

rednoah wrote: 14 Sep 2019, 20:35 Post-processing features can be applied to an existing set of files via AttributesIcon Apply assuming that xattr metadata is readily available.
Screenshot
:idea: Please read the FAQ and How to Request Help.
Stewart
Posts: 20
Joined: 08 May 2024, 06:44

Re: Date Added Change To Date Created In Jellyfin

Post by Stewart »

Hi rednoah

Thank you for info how to change file attributes which i have got working fine.

I have set in jellyfin to use file creation date for date added but does not seem to work without removing file and adding back into jellyfin?

I wanted to know if filebot could change date added to date created in jellyfin metadata?

Regards

Stewart
User avatar
rednoah
The Source
Posts: 24169
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Date Added Change To Date Created In Jellyfin

Post by rednoah »

Stewart wrote: 29 Sep 2025, 06:03 I wanted to know if filebot could change date added to date created in jellyfin metadata?
FileBot has no built-in way of talking to Jellyfin. Although what you want to do might be possible via a custom post-processing script we'd first have to figure out how to directly interface with Jellyfin and modify its internal database.
:idea: Please read the FAQ and How to Request Help.
Stewart
Posts: 20
Joined: 08 May 2024, 06:44

Re: Date Added Change To Date Created In Jellyfin

Post by Stewart »

Hi rednoah

That would be great but i would not know how to do that, thanks anyway i will have to go through all my movie and do it manually in jellyfin

Thanks for you quick responses👍

Regards

Stewart
User avatar
rednoah
The Source
Posts: 24169
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Date Added Change To Date Created In Jellyfin

Post by rednoah »

Well... looked easy at first, but did take quite a few hours in the end. The Jellyfin API is insane and stupid. Updating tags with API fails and corrupts item and api.py#L24 did help though and it got it working.

:arrow: [Script] Set Jellyfin DateCreated property
:idea: Please read the FAQ and How to Request Help.
Stewart
Posts: 20
Joined: 08 May 2024, 06:44

Re: Date Added Change To Date Created In Jellyfin

Post by Stewart »

Hi rednoah

Thanks a lot but can I just run this script or do I need to edit to suit my setup if so where ?

Please advise

Regards

Stewart
User avatar
rednoah
The Source
Posts: 24169
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Date Added Change To Date Created In Jellyfin

Post by rednoah »

You'll need to adjust the first few lines to match your Jellyfin server configuration:

Groovy: Select all

def host = '127.0.0.1'
def port = 8096
def auth = 'YOUR_API_KEY'
:idea: Please read the FAQ and How to Request Help.
Stewart
Posts: 20
Joined: 08 May 2024, 06:44

Re: Date Added Change To Date Created In Jellyfin

Post by Stewart »

Hi rednoah

I tried the following but did not work for me
Def host 192.0.168.6
Def port 8096
def auth I copiied and pasted from api in jellyfin api’s

What have i done wrong?

Regards

Stewart
User avatar
rednoah
The Source
Posts: 24169
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Date Added Change To Date Created In Jellyfin

Post by rednoah »

:?: How did you run a test? I guess I was doing test runs in the editor using a previously renamed file as sample file. It has occurred to me that if you organize files with FileBot, then Jellyfin might need a while to refresh. We change the date added property on the item if the item hasn't been added yet.


:arrow: Please try the revised [Script] Set Jellyfin DateCreated property code. The code will now start by asking Jellyfin to refresh its libraries and then wait for 15 seconds. Hopefully that'll make it work right after Rename.
:idea: Please read the FAQ and How to Request Help.
Stewart
Posts: 20
Joined: 08 May 2024, 06:44

Re: Date Added Change To Date Created In Jellyfin

Post by Stewart »

Hi rednoah,

I have created user script using your code and edited first few lines as below.

def host = 192.0.168.06
def port = 8096
def auth = 1aa3449d1862402f92bb6e5d6e4aab58 Note! (This in red solid box white lettering is this highlighting an error?)

I then tick this user script in post processing section to execute when renaming files

Regards

Stewart
User avatar
rednoah
The Source
Posts: 24169
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Date Added Change To Date Created In Jellyfin

Post by rednoah »

Looks like you stripped the '...' that delimit the String value. That won't work.

Example code is this:

Groovy: Select all

def host = '127.0.0.1'
def port = 8096
def auth = 'YOUR_API_KEY'
So your code should be this

Groovy: Select all

def host = '192.0.168.06'
def port = 8096
def auth = '1aa3449d1862402f92bb6e5d6e4aab58'
That should work. For testing and debugging you can also run the code in the script editor. That'll use the most recently renamed files as sample data and give you some debug output. It'll also tell you about syntax errors.
:idea: Please read the FAQ and How to Request Help.
Stewart
Posts: 20
Joined: 08 May 2024, 06:44

Re: Date Added Change To Date Created In Jellyfin

Post by Stewart »

Hi rednoah,

Ran script after delimiters and now works great

Thanks that's save me a lot of time

Regards

Stewart
Stewart
Posts: 20
Joined: 08 May 2024, 06:44

Re: Date Added Change To Date Created In Jellyfin

Post by Stewart »

Hi rednoah

Sorry it’s still not working thought it was but looked at some that i changed myself 🤪

Dont see any syntax errors so dont know why its not working

Any ideas

Regards

Stewart
User avatar
rednoah
The Source
Posts: 24169
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Date Added Change To Date Created In Jellyfin

Post by rednoah »

:idea: You can add a few println to see what's happening / not happening:

Groovy: Select all

def host = '192.0.168.6'
def port = 8096
def auth = '1aa3449d1862402f92bb6e5d6e4aab58'

// refresh and wait
curl "http://${host}:${port}/Library/Refresh", [:], Authorization: "MediaBrowser Token=$auth"
// sleep 15000

// get all items
def r = curl "http://$host:$port/Items?Recursive=true&Fields=Path,Genres,SortName,Studios,Writer,Taglines,LocalTrailerCount,OfficialRating,CumulativeRunTimeTicks,ItemCounts,Metascore,AirTime,DateCreated,People,Overview,CriticRating,CriticRatingSummary,Etag,ShortOverview,ProductionLocations,Tags,ProviderIds,ParentId,RemoteTrailers,SpecialEpisodeNumbers,MediaSources,VoteCount,RecursiveItemCount,PrimaryImageAspectRatio", Authorization: "MediaBrowser Token=$auth"

// index items by folder name / file name
def index = r.Items.findAll{ it.MediaType == 'Video' }.groupBy{ it.Path.toFile().getRelativePathTail(2) }
println "INDEX: ${index.size()}"

model.each{ source, target ->
	println "FILE: ${target.getRelativePathTail(2)}"

	// lookup item by folder name / file name
	index[target.getRelativePathTail(2)].each{
		println "UPDATE: $it.Id"
		it.DateCreated = d.format(/yyyy-MM-dd/)
		// update item
		curl "http://$host:$port/Items/$it.Id", it, Authorization: "MediaBrowser Token=$auth"
	}
	?: "FILE NOT FOUND: $target"
}



:?: What does the output say when you run it in the script editor for testing? A working run might look like this:

Screenshot
:idea: Please read the FAQ and How to Request Help.
Stewart
Posts: 20
Joined: 08 May 2024, 06:44

Re: Date Added Change To Date Created In Jellyfin

Post by Stewart »

Hi rednoah,

Think I copied and pasted correct but see log below

Code: Select all

Run Script
POST http://192.168.0.5:8096/Library/Refresh {}
GET http://192.168.0.5:8096/Items?Recursive=true&Fields=Path,Genres,SortName,Studios,Writer,Taglines,LocalTrailerCount,OfficialRating,CumulativeRunTimeTicks,ItemCounts,Metascore,AirTime,DateCreated,People,Overview,CriticRating,CriticRatingSummary,Etag,ShortOverview,ProductionLocations,Tags,ProviderIds,ParentId,RemoteTrailers,SpecialEpisodeNumbers,MediaSources,VoteCount,RecursiveItemCount,PrimaryImageAspectRatio
INDEX: 5311
FILE: The Lost Century - And How to Reclaim It (2023) [tmdbid-1136906]/The Lost Century - And How to Reclaim It (2023) - 1080p.mp4
[FILE NOT FOUND: /Volumes/Media/Movies/The Lost Century - And How to Reclaim It (2023) [tmdbid-1136906]/The Lost Century - And How to Reclaim It (2023) - 1080p.mp4]
DONE
Yes ip address is correct told you the wrong one sorry

I think file not found looks like error?

Regards

Stewart
User avatar
rednoah
The Source
Posts: 24169
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Date Added Change To Date Created In Jellyfin

Post by rednoah »

According to the log, your Jellyfin library does not contain the file at hand:

Code: Select all

The Lost Century - And How to Reclaim It (2023) [tmdbid-1136906]/The Lost Century - And How to Reclaim It (2023) - 1080p.mp4

You can use the following code to see the file paths that are in your Jellyfin library:

Groovy: Select all

def host = '192.168.0.5'
def port = 8096
def auth = '1aa3449d1862402f92bb6e5d6e4aab58'

def r = curl "http://$host:$port/Items?Recursive=true&Fields=Path,Genres,SortName,Studios,Writer,Taglines,LocalTrailerCount,OfficialRating,CumulativeRunTimeTicks,ItemCounts,Metascore,AirTime,DateCreated,People,Overview,CriticRating,CriticRatingSummary,Etag,ShortOverview,ProductionLocations,Tags,ProviderIds,ParentId,RemoteTrailers,SpecialEpisodeNumbers,MediaSources,VoteCount,RecursiveItemCount,PrimaryImageAspectRatio", Authorization: "MediaBrowser Token=$auth"

r.Items.findAll{
	println "[$it.MediaType] $it.Path"
}
:idea: Please read the FAQ and How to Request Help.
Stewart
Posts: 20
Joined: 08 May 2024, 06:44

Re: Date Added Change To Date Created In Jellyfin

Post by Stewart »

Hi rednoah

Path Reported was as follows

/volume1/Media/Movies/The Lost Century - And How to Reclaim It (2023) [tmdbid-1136906]/The Lost Century - And How to Reclaim It (2023) - 1080p.mp4

This is correct and where all my movies are?

Regards

Stewart
User avatar
rednoah
The Source
Posts: 24169
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Date Added Change To Date Created In Jellyfin

Post by rednoah »

That can't be right. It's either in the list or it isn't. It can't be both. Unless something changed over time.


:?: What does the output say for this one? I've added even more debug output:

Groovy: Select all

def host = '192.168.0.5'
def port = 8096
def auth = '1aa3449d1862402f92bb6e5d6e4aab58'


// refresh and wait
curl "http://${host}:${port}/Library/Refresh", [:], Authorization: "MediaBrowser Token=$auth"
sleep 5000

// get all items
def r = curl "http://$host:$port/Items?Recursive=true&Fields=Path,Genres,SortName,Studios,Writer,Taglines,LocalTrailerCount,OfficialRating,CumulativeRunTimeTicks,ItemCounts,Metascore,AirTime,DateCreated,People,Overview,CriticRating,CriticRatingSummary,Etag,ShortOverview,ProductionLocations,Tags,ProviderIds,ParentId,RemoteTrailers,SpecialEpisodeNumbers,MediaSources,VoteCount,RecursiveItemCount,PrimaryImageAspectRatio", Authorization: "MediaBrowser Token=$auth"

// index items by folder name / file name
def index = r.Items.findAll{ it.MediaType == 'Video' }.groupBy{ it.Path.toFile().getRelativePathTail(2) }
println "INDEX: ${index.size()}"

model.each{ source, target ->
	def key = target.getRelativePathTail(2)
	if (key in index) {
		// lookup item by folder name / file name
		index[key].each{
			println "UPDATE: $it.Id"
			it.DateCreated = d.format(/yyyy-MM-dd/)
			// update item
			curl "http://$host:$port/Items/$it.Id", it, Authorization: "MediaBrowser Token=$auth"
		}
	} else {
		index.each{ k, v -> println "* [$key] ≠ [$k]" }
	}
}

println ""
That'll either print UPDATE or * [A] ≠ [A] and the latter can't possibly be because A = A.
:idea: Please read the FAQ and How to Request Help.
Post Reply