Jump to content

api command to refresh movies / seasons /episodes with missing images


horstepipe

Recommended Posts

horstepipe

Hello

If somebody has a few minutes, would you please bring me to the right direction 🙂

Scrolling through the reports plugin, e.g. reports selected for seasons, I'm seeing at the status column that some primary images are missing.

So what I'd like to accomplish is a command which only checks for these missing images, as refreshing the whole library takes very long and would hit the apis hard.

 

As the Emby api is very extensive, for sure there is a way doing this?

Link to comment
Share on other sites

Hi, you'd have to do this in two steps, first use the api to query for items (seasons) missing primary images.

Then once you have that list, then you'd use the api to refresh the metadata on those.

  • Thanks 1
Link to comment
Share on other sites

  • 1 month later...
horstepipe
On 6/26/2022 at 8:56 PM, Luke said:

Hi, you'd have to do this in two steps, first use the api to query for items (seasons) missing primary images.

Then once you have that list, then you'd use the api to refresh the metadata on those.

just coming back to this.
I'd like to limit the api call to seasons (and episodes later) which released maximal 2 months ago. As mostly these items have missing images.

Is there a way doing this? I am just seeing

minPremiereDate 

which is a fixed date and no period of time.

Best regards

Edited by horstepipe
Link to comment
Share on other sites

Yes I would use MinPremiereDate and just make the calculation on your end of what that value should be.

  • Agree 1
Link to comment
Share on other sites

  • 1 month later...
horstepipe

soo I'm having this call:

curl "https://emby.url/emby/Users/xxx/Items?IncludeItemTypes=Episode&Recursive=True&MinPremiereDate=2022-06-01&ExcludeLocationTypes=Virtual&Fields=DateCreated,SeriesName&Limit=500&GroupItems=false&SortBy=DateCreated&SortOrder=Descending&format=json&api_key=yyy"

which does what I want for episodes.

The only issue I'm facing is that it also shows recorded episodes in the output.

How can I exclude them?

Best regards

Link to comment
Share on other sites

horstepipe

Here is my bash script if anybody is interested:

date=`date --iso-8601 --date='-1 month'`
curl "https://emby.url/emby/Users/*user-id*/Items?Recursive=True&IncludeItemTypes=Episode,Movie&MinPremiereDate=$date&ExcludeLocationTypes=Virtual&Fields=DateCreated,SeriesName&GroupItems=false&SortBy=DateCreated&SortOrder=Descending&format=json&api_key=*api-key*" | jq -r '.Items[]' | jq -r .Id | while read ids
do
curl -X POST "https://*emby.url*/emby/Items/$ids/Refresh?Recursive=false&MetadataRefreshMode=FullRefresh&ImageRefreshMode=Default&ReplaceAllMetadata=true&ReplaceAllImages=false&api_key=*api-key*" -H "accept: */*"
done

It refreshes items with a premier date one month ago. You can change it in the upper line.

some questions though:

As mentioned, what is the best way to exclude recordings?

For metadatarefreeshmode and imagerefreshmode there are three options, what is ValidationOnly for?

ReplaceAllImages = false will still fetch missing images, correct?

Edited by horstepipe
Link to comment
Share on other sites

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...