is there a easier way to update movie Metadata
Moderator: Forum Moderators
is there a easier way to update movie Metadata
Is there a easy way to update the metaData from MythWeb or API?
currently I have load the video, scan for updates, scroll down to new movie and select update video to edit so lookup can understand movie name, then retrieve details and perhaps select one of a few options.
Ideally I would like to be able to update the movie title and inetref from mythweb or API can ask the backend to load metadata and artwork etc..
but the current api doesn't seem to be able to do this.
Any ideas?
currently I have load the video, scan for updates, scroll down to new movie and select update video to edit so lookup can understand movie name, then retrieve details and perhaps select one of a few options.
Ideally I would like to be able to update the movie title and inetref from mythweb or API can ask the backend to load metadata and artwork etc..
but the current api doesn't seem to be able to do this.
Any ideas?
Re: is there a easier way to update movie Metadata
Did you try this: https://www.mythtv.org/wiki/Video_Servi ... eoMetadata ?
Since it changes data, is must be a POST, not a GET. For example:
Since it changes data, is must be a POST, not a GET. For example:
Code: Select all
curl --data 'Id=4' --data 'Title=Some Title' --data 'Inetref=1234' localhost:6544/Video/UpdateVideoMetadata
Re: is there a easier way to update movie Metadata
I was wanting to update Images for video list , from the backend .
doing it via frontend is a bit fiddly
doing it via frontend is a bit fiddly
-
- Junior
- Posts: 51
- Joined: Tue May 24, 2022 10:18 am
Re: is there a easier way to update movie Metadata
When I am in the frontend I go to Videos and press "m" and then select scan for changes, this updates the video files and then looks for the metadata and after a short while it (usually) updates with the metadata. I haven't tested this recently as I have changed my server and still have a few creases to iron out before everything is up and running how I want, but that is how I have updated my videos for years...
Re: is there a easier way to update movie Metadata
I'm not sure if scan for changes resets the "movie" file name ? ie if the filename isn't quiet right it fails to match name, so I have to update the "title" and refresh metadata.
if would be great if this was a function on Web or I can script it from the backend.
if would be great if this was a function on Web or I can script it from the backend.
-
- Senior
- Posts: 278
- Joined: Thu Feb 23, 2023 8:55 pm
- Location: Safe outside my gilded cage
Re: is there a easier way to update movie Metadata
Every time I try to use the GUI to make changes to the metadata, they just get overwritten when I do a scan/retrieve. I wish that worked.
Most of the time I end up renaming the file. In one case, I had to update the metadata on the file using mp4tags/mp4info (it picked up "WALKING_DEAD" from the DVD which kept matching TALKING_DEAD until I changed it to THE_WALKING_DEAD).
And then when it finds a video I'm just starting to encode, I end up with hash collisions and I've never been able to get rid of those entries short of editing mysql.
I'm using ttvdb4 for TV data (which seems to include TV shows ripped from DVD according to the logs). Suppose I should try the others at some point.
P.S. I was a little confused what was wrong with Bill's suggestion, since it's pointed at localhost I assume the example was run from the backend.
Most of the time I end up renaming the file. In one case, I had to update the metadata on the file using mp4tags/mp4info (it picked up "WALKING_DEAD" from the DVD which kept matching TALKING_DEAD until I changed it to THE_WALKING_DEAD).
And then when it finds a video I'm just starting to encode, I end up with hash collisions and I've never been able to get rid of those entries short of editing mysql.
I'm using ttvdb4 for TV data (which seems to include TV shows ripped from DVD according to the logs). Suppose I should try the others at some point.
P.S. I was a little confused what was wrong with Bill's suggestion, since it's pointed at localhost I assume the example was run from the backend.
-
- Newcomer
- Posts: 6
- Joined: Thu Jun 01, 2023 3:52 pm
Re: is there a easier way to update movie Metadata
If you're adding new files from a separate program then maybe this script will help. Given a file name and an inetref from say TTMDB it adds the file and updates it inetref in the myth database using the services API:
I call this script as one of the post processing tasks in the program that generates the movie files.
I'm using wget here rather than curl as the script is running in a docker container.
I then have the following script in my /etc/cron.hourly:
This then populates the metadata images. You could run this command at the end of the script above but as I said for me it's running in a docker container which doesn't have access to mythutil.
I find this all quite handy if you have an external program that knows the filename and the inetref. Since the script adds the entry the myth database with the correct inetref then when you run the scanvideos it will always get the right metadata as the inetref has already been set correctly.
Code: Select all
#!/bin/bash
SERVICE_API=http://localhost:6544/Video/
FILENAME=$1
INETREF=$2
# Add the file to Myth
added=$(wget -q --post-data "FileName=${FILENAME}&HostName=mythbe" "${SERVICE_API}AddVideo" -O -)
# If added successfully
if [[ $added == *"true"* ]]; then
# Lookup the details of the file just added
xml=$(wget -q --post-data "FileName=${FILENAME}" "${SERVICE_API}GetVideoByFileName" -O -)
# Search through the xml finding the id
id=$(echo $xml| sed "s/.*<Id>\(.*\)<\/Id>.*/\1/")
# Update video meta data
response=$(wget -q --post-data "Id=${id}&Inetref=${INETREF}" "${SERVICE_API}UpdateVideoMetadata" -O -)
fi
I'm using wget here rather than curl as the script is running in a docker container.
I then have the following script in my /etc/cron.hourly:
Code: Select all
/usr/bin/mythutil --scanvideos
I find this all quite handy if you have an external program that knows the filename and the inetref. Since the script adds the entry the myth database with the correct inetref then when you run the scanvideos it will always get the right metadata as the inetref has already been set correctly.
Mythtv: v33 User since 2006
BE: HP i5 mini, Ubuntu 22.04, 24TB NAS (DS923+)
FEx3: Beelink Mini S, Lubuntu 22.04
BE: HP i5 mini, Ubuntu 22.04, 24TB NAS (DS923+)
FEx3: Beelink Mini S, Lubuntu 22.04
Re: is there a easier way to update movie Metadata
so to break the script down all I need to do is update the Inetref field and then re-scan videos..
this sounds like a method I can use.
this sounds like a method I can use.
-
- Newcomer
- Posts: 6
- Joined: Thu Jun 01, 2023 3:52 pm
Re: is there a easier way to update movie Metadata
Basically yes. If the inetref is set correctly then a video scan will populate the correct meta data and images.
(In the Video settings tick the box for updating meta data after a scan)
(In the Video settings tick the box for updating meta data after a scan)
Mythtv: v33 User since 2006
BE: HP i5 mini, Ubuntu 22.04, 24TB NAS (DS923+)
FEx3: Beelink Mini S, Lubuntu 22.04
BE: HP i5 mini, Ubuntu 22.04, 24TB NAS (DS923+)
FEx3: Beelink Mini S, Lubuntu 22.04
Re: is there a easier way to update movie Metadata
I just need to get / make script to get Inetref which I think should be somewhat easy??