Jump to content

How to refresh the specified media library file through the API


Recommended Posts

Posted

How can I refresh the media library file of a movie through the API, not the media metadata. For example, when I add a subtitle file or a new version to this movie, I need to update the media library file of the movie folder to get this update instead of metadata.
The endpoint I am trying now is:
url = f"{EMBY_URL}/emby/Items/{movie_id}/Refresh"
params = {
"MetadataRefreshMode": "Default",
"ImageRefreshMode": "Default",
"ReplaceAllImages": "false",
"ReplaceAllMetadata": "false",
"Recursive": "true",
}

But it only refreshes the metadata, please help me

 

Happy2Play
Posted

I don't really follow as that is what the web client uses.

Quote

/Items/itemid/Refresh?Recursive=true&ImageRefreshMode=FullRefresh&MetadataRefreshMode=FullRefresh&ReplaceAllImages=false&ReplaceAllMetadata=true

 

2024-10-13 07:50:58.943 Info Server: http/1.1 POST http://‌‍‍localhost‌:8091/emby/Items/88693/Refresh?Recursive=true&ImageRefreshMode=FullRefresh&MetadataRefreshMode=FullRefresh&ReplaceAllImages=false&ReplaceAllMetadata=true&X-Emby-Client=Emby Web&X-Emby-Device-Name=Microsoft Edge Windows&X-Emby-Device-Id=b162d34e-1e28-4de9-8529-624d6ca27606&X-Emby-Client-Version=4.8.10.0&X-Emby-Token=‌d4a3f03d2aa449d199431cde0715b9b4‌&X-Emby-Language=en-us. Source Ip: ‌‍‍::1‌, UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36 Edg/130.0.0.0
2024-10-13 07:50:58.948 Info App: Refresh metadata requested on 88693
2024-10-13 07:50:58.948 Info Server: http/1.1 Response 204 to ‌‍‍::1‌. Time: 5ms. POST http://‌‍‍localhost‌:8091/emby/Items/88693/Refresh?Recursive=true&ImageRefreshMode=FullRefresh&MetadataRefreshMode=FullRefresh&ReplaceAllImages=false&ReplaceAllMetadata=true&X-Emby-Client=Emby Web&X-Emby-Device-Name=Microsoft Edge Windows&X-Emby-Device-Id=b162d34e-1e28-4de9-8529-624d6ca27606&X-Emby-Client-Version=4.8.10.0&X-Emby-Token=‌d4a3f03d2aa449d199431cde0715b9b4‌&X-Emby-Language=en-us
2024-10-13 07:50:58.951 Debug SqliteItemRepository: GetitemById Movie 88693 E:\Media\Movies - nfo\Daybreakers (2009)\Daybreakers (2009) - 4K.mkv
2024-10-13 07:50:59.015 Debug App: Running FFProbeProvider for E:\Media\Movies - nfo\Daybreakers (2009)\Daybreakers (2009) - 4K.mkv
2024-10-13 07:50:59.018 Info MediaProbeManager: ProcessRun 'ffprobe' Execute: C:\Users\Media\Desktop\TEST\system\ffprobe.exe -i file:"E:\Media\Movies - nfo\Daybreakers (2009)\Daybreakers (2009) - 4K.mkv" -threads 0 -v info -print_format json -show_streams -show_chapters -show_format -show_data
2024-10-13 07:50:59.036 Debug MediaProbeManager: ProcessRun 'ffprobe' Started.
2024-10-13 07:50:59.437 Info MediaProbeManager: ProcessRun 'ffprobe' Process exited with code 0 - Succeeded
2024-10-13 07:50:59.483 Debug App: Running MovieDbProvider for E:\Media\Movies - nfo\Daybreakers (2009)\Daybreakers (2009) - 4K.mkv
2024-10-13 07:50:59.483 Info HttpClient: GET https://api.themoviedb.org/3/movie/19901?api_key=‌f6bd687ffxxxxxxxx6ff2cxxxx2669‌&append_to_response=alternative_titles,reviews,casts,releases,images,keywords,trailers&language=en-US&include_image_language=en-US,null
2024-10-13 07:50:59.515 Debug App: Running TvdbMovieProvider for E:\Media\Movies - nfo\Daybreakers (2009)\Daybreakers (2009) - 4K.mkv
2024-10-13 07:50:59.515 Info HttpClient: GET https://api4.thetvdb.com/v4/movies/2365/extended?meta=translations
2024-10-13 07:50:59.611 Debug App: Running OmdbItemProvider for E:\Media\Movies - nfo\Daybreakers (2009)\Daybreakers (2009) - 4K.mkv
2024-10-13 07:50:59.612 Info HttpClient: GET https://private.omdbapi.com?apikey=‌xxxxxx‌&i=tt0433362&plot=short&r=json
2024-10-13 07:50:59.798 Debug App: Running MovieNfoProvider for E:\Media\Movies - nfo\Daybreakers (2009)\Daybreakers (2009) - 4K.mkv
2024-10-13 07:51:00.198 Debug App: Saving nfo metadata for E:\Media\Movies - nfo\Daybreakers (2009)\Daybreakers (2009) - 4K.mkv to E:\Media\Movies - nfo\Daybreakers (2009)\Daybreakers (2009) - 4K.nfo.

As you see it reprobes the media file.

Posted

HI, yes that should work fine.

Posted
7 hours ago, Luke said:

HI, yes that should work fine.

Sorry, I checked the log and found that it was indeed updated, but the subtitle file did not appear. Multiple versions of movies cannot match the same subtitle file. My file name is as follows:
/Movies
/movie name
movie name-edition1.mp4
movie name-edition2.mp4
movie name.spa.1.srt
movie name.spa.2.srt

I tested and found that only the subtitle file named movie name-edition1.spa.1.srt , movie name-edition1.mp4 will recognize this subtitle. How can I make multiple versions of movies recognize the same subtitle file?

Posted
On 10/14/2024 at 12:03 AM, terse said:

Sorry, I checked the log and found that it was indeed updated, but the subtitle file did not appear. Multiple versions of movies cannot match the same subtitle file. My file name is as follows:
/Movies
/movie name
movie name-edition1.mp4
movie name-edition2.mp4
movie name.spa.1.srt
movie name.spa.2.srt

I tested and found that only the subtitle file named movie name-edition1.spa.1.srt , movie name-edition1.mp4 will recognize this subtitle. How can I make multiple versions of movies recognize the same subtitle file?

@terseyou need to copy the subtitle files and assign them to each version independently. This is because even though they are the same movie, each version may require different timings.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...