Video-Hub-App icon indicating copy to clipboard operation
Video-Hub-App copied to clipboard

Implement some form of Daemon Mode

Open cal2195 opened this issue 5 years ago • 4 comments

Interesting usecase time! 😄

Currently, I have one instance of VHA running on a linux server with all my data, which I leave running and has the duty of importing files, and extracting metadata and thumbnails for me (means I can leave it running, and also faster as the remote files are local to the server).

I can them mount the drive over the network, and use a local copy of VHA to access the library!

While I've been doing this from the start and it has been working great, it has it's own set of problems:

  • The remote VHA is constantly running, so it never reloads the loaded library when I rescan, so any changes I've made in the meantime on the local client (tags, ratings), get overridden with whatever the remote had in memory at the time. (Why I wanted #145)
  • I have to manually remote into the server to initiate a rescan of the library.

Some possible ways of improving this usecase:

  • Daemon Mode: the ability to start up the client with command line args, eg. ./vha --library=path/to/lib --rescan-library --quit which would start up vha, load the library, run a rescan, and quit when finished. This would allow for metadata to be (mostly) preserved, as it will load in the latest library every time, and also allows for cron scheduling in a timely manner.

  • Filesystem watching: adding something like inotify to watch the filesystem for changes, and import new files as soon as they appear. This coupled with loading in the new library changes before rescanning could work well, except if the files are still being written to when you get notified (I think you can react to different events, eg. file close).

  • Remote client access: Basically the idea of being able to access the remote client over HTTP in a normal chrome browser - This would be awesome as you'd only ever be running a single client, so metadata is safe, and you could access it from any device. By far the hardest to implement though.

Personally the daemon mode seems quite nice, especially if we could flesh out other functions in the future and possibly prevent the gui from starting up too. 💡

Any thoughts on all this, or any fresh ideas welcome! 👍

cal2195 avatar Apr 04 '19 13:04 cal2195

You're doing really awesome and cool things with this app ❤️

I don't have any specific ideas at this time. Your suggestion about starting the client with command line arguments seems most-direct. I believe the app is already set up for command line arguments:

https://github.com/whyboris/Video-Hub-App/blob/master/main.ts#L18

Since all the extraction code is inside the main.ts (and the associated main-support files), perhaps it will be easy to run the app command-line with rather little extra code work.

whyboris avatar Apr 14 '19 15:04 whyboris

I closed #145 (see comment, feel free to re-open).

I'm keeping this issue open as it sounds pretty cool and likely useful (and it would need to handle the tags in tandem, so perhaps this is the place to have the discussion).

This feature would not be in Version 2 (releasing in about 2 weeks); I'm unlikely to work on it (not my use case), I'm willing to merge a PR in if it doesn't break functionality; let's discuss before you do too much work (just in case) 🤝

whyboris avatar Aug 18 '19 21:08 whyboris

Related: #477 😊

whyboris avatar Aug 15 '20 23:08 whyboris

We're now one step closer as VHA has "official" server code 🎉 with #603

whyboris avatar Dec 17 '20 15:12 whyboris