[mythtv-users] Resurrecting mythadder.py to repopulate videometadata when plugging in a usb drive with media

Piotr Oniszczuk piotr.oniszczuk at gmail.com
Fri Jul 22 09:28:15 UTC 2022



> Wiadomość napisana przez Jay Harbeston <jharbestonus at gmail.com> w dniu 21.07.2022, o godz. 14:19:
> 
> --I see that the Storage group needs to be added, and my plan is to just add /media/mythtv as the directory on the frontend in 
> Settings -> Video settings-> General Settings -> Directories that Hold videos so I can plug the external drive with video into it.
> 


IIRC mythadder concept not requires dedicated SG.

mythadder simply moves metadata from mythtv movies metadata DB table to aux/cache table (when ext. drive is disconnected) or vice versa (when you connect ext. drive).

Movie files from ext. drive can be in subdirectory of dir where permanent movies are stored or can be in dedicated additional dir defined in video SG.

In my home system:

- I have 5 usb attached drives labeled USB-Movies[1..5]
- Backend has video SG with /myth/video dir. 
- When I’m connecting USB drive, media-automout mounts USB drive content to /myth/video/USB-Movies[1..5] and calls mythadder
- Mythadder moves metadata of all USB movies to mythtv movies table - so all my 4 disk-less remote frontends started to offer movies from USB drive.
- When user asks for watching movie from USB drive - backend starts stream (by myth protocol) movie from /myth/video/USB-Movies[1..5]/<movie> to remote disk-less frontend
- Disconnecting USB drive moves all relevant metadata from movies DB table to aux/cache table (so metadata are not lost) - but becomes not visible to my remote frontends.     


> --Does that make sense, or does it need to be plugged into the backend and add /media/mythtv to the storage groups?
> 

It is best to connect ext. USB drive to backed - as backend is place where streaming starts when you watch movie.
If you want to have setup where user connects ext. USB to one from remote frontends, then i see 2 options:

1. at remote frontend host - where you are connecting ext.drive:
- scripting mounts USB drive remotely to backed (i.e. via NFS or CIFS or whatever (you can do this i.e. in media-automount script)
- scripting calls locally mythadder to update with mythtv movies DB with just attached movies from ext.USB.

2.remote frontend host - where you are connecting ext.drive - is also slave backend with defined its local storage (including ext. USB storage ) in mythtv video SG.

Comparing, Option2 is better because there is no traffic tromboning between remote fe and be when you play movie on the same host where you have connected ext. USB. (traffic tromboning in Option1 will be like this: ExUSB->remoteFE->(NFS)->BE->(mythproto)->remoteFE->Display)

> 
> Will the updated myth adder and auto mounter work on either the frontend or the backend, or ONLY on the back end?

Should work ok from mythadder perspective - as long as ext.USB drive block device is local to mythadder (in other words: all is n the same host)

> 
> I’m not sure how videometadata works regarding frontend vs back end directories, but it would be nice if it would work on the frontend as I keep the backend in a different part of the house. :-)

As i mention - you can go with 2 options here.

I would go with option2.

First thing i’ll do will be test: is mythtv capable to offer videos hosted on multiple discrete remote hosts (backend and remote frontend with connected ext.USB)

You can do this i.e. by:
-on your remote frontend make sure ext.USB is mounted in persistent mount point
-configure/start slave backend on remote frontend
-on slave backend config add video SG with dir where ext.USB is mounted
-connect ext.USB, make sure it is mounted ok (in video SG defined dir)
-scan videos
-check: do you see videos from ext.USB on remote frontend / other  frontends and test can you watch
-if yes - ask to download metadata and see is it seen by others frontends

if this will work - then we are in home :-)
(you can play i.e. with media-automounter to automatise all this :-) )

good luck!




More information about the mythtv-users mailing list