Jump to content

Library Sync Questions


Recommended Posts

Posted

I am creating this post to get a better idea of how Emby works under the hood. I hope the answers provided may answer questions that I and other somewhat new users like myself may have in the initial stages.

 

I decided to change the user I was using locally to run Emby to a new user. EX: c:\users\jsmith to c:\users\jdoe. To attempt to achieve this, I used a combination of the Server Configuration Backup plugin and Luke's manual migration instructions here:

 

https://emby.media/community/index.php?/topic/10427-how-to-migrate-emby-server/

 

For clarification purposes,

new emby-server directory (NESD)= c:\users\jdoe\appdata\roaming\emby-server\     

old emby-server directory= c:\users\jsmith\appdata\roaming\emby-server\

 

These are the steps I followed:

  • Backup old emby server directory using the Server Configuration Backup plugin
  • Start a clean Emby installation and go through with the installation and user setup. A new user is created, I believe default name is the current windows user :EX jdoe
  • Copy the emby old plugin directory to the new Emby-server directory and restart the emby application
  • Run the emby backup plugin and restore the last backup with user information, preferences etc
  • Login in with one of the old accounts and delete the newly created Emby account. (jdoe)
  • Stop the emby service and copy the following directories to the new emby-server directory.
    • NESD\data/collections
    • NESD\metadata
    • NESD\config

    • NESD\data\playlists

    • NESD/data/displaypreferences.db

    • NESD/data/userdata_v2.db

    • NESD\data\users.db

    • NESD\data\library.db*** (I thought copying this over would save me initial scanning time to recreate this nearly 1GB file since all the media locations and data are the same...apparently not)

 

After launching Emby with the files copied, i noticed in the Metadata Manager that the paths to Movies,Music and TV were still pointing to the Old Emby server and I had no means of changing this. I am assuming that this information may be stored somewhere in the library.db file. The initial scan seemed to be moving along though rather slowly. I stopped it since I wasn't sure whether there may be other references to the old emby server that I was not aware of and these would probably cause instability in the long run.

 

Here's my first question:

1) Is there a means of migrating the library.db file that would pick up the new emby-server location and possibly minimize the scan time at the new location? Can this be reliably done maybe with a SQLite editor etc?

 

I proceeded to delete the library.db file and restart Emby to start a scan from scratch. Except for the main metadata folder, all my metadata is stored in nfo files within the media libraries themselves.  Here is an excerpt of the scan log data:

 

2016-10-16 15:25:57.0950 Debug App: Running FFProbeProvider for \\netdrv\movies\PAY_THE_GHOST_(2015)
2016-10-16 15:25:57.2050 Debug MediaEncoder: C:\Users\Kayadmin\AppData\Roaming\Emby-Server\ffmpeg\20160410\ffprobe.exe -probesize 1G -analyzeduration 200M -i concat:"\\netdrv\movies\PAY_THE_GHOST_(2015)\VIDEO_TS\VTS_01_1.VOB|\\netdrv\movies\PAY_THE_GHOST_(2015)\VIDEO_TS\VTS_01_2.VOB|\\netdrv\movies\PAY_THE_GHOST_(2015)\VIDEO_TS\VTS_01_3.VOB|\\netdrv\movies\PAY_THE_GHOST_(2015)\VIDEO_TS\VTS_01_4.VOB" -threads 0 -v info -print_format json -show_streams -show_chapters -show_format
2016-10-16 15:25:59.2512 Debug MediaEncoder: C:\Users\Kayadmin\AppData\Roaming\Emby-Server\ffmpeg\20160410\ffmpeg.exe -probesize 1G -analyzeduration 200M -i concat:"\\netdrv\movies\PAY_THE_GHOST_(2015)\VIDEO_TS\VTS_01_1.VOB|\\netdrv\movies\PAY_THE_GHOST_(2015)\VIDEO_TS\VTS_01_2.VOB|\\netdrv\movies\PAY_THE_GHOST_(2015)\VIDEO_TS\VTS_01_3.VOB|\\netdrv\movies\PAY_THE_GHOST_(2015)\VIDEO_TS\VTS_01_4.VOB" -map 0:v:1 -an -filter:v idet -frames:v 500 -an -f null /dev/null
2016-10-16 15:26:00.1512 Debug App: Running MovieNfoProvider for \\netdrv\movies\PAY_THE_GHOST_(2015)
2016-10-16 15:26:00.1982 Debug App: Running OmdbItemProvider for \\netdrv\movies\PAY_THE_GHOST_(2015)
2016-10-16 15:26:00.1982 Info HttpClient: HttpClientManager GET: https://www.omdbapi.com/?i=tt3733778&tomatoes=true
2016-10-16 15:26:00.4033 Debug App: Running MovieDbProvider for \\netdrv\movies\PAY_THE_GHOST_(2015)
2016-10-16 15:26:00.4033 Info HttpClient: Checking for cache file C:\Users\kodi\AppData\Roaming\Emby-Server\cache\httpclient\ee2a697e4844f5fa2b1efa1b23d845ef
2016-10-16 15:26:00.4152 Info HttpClient: HttpClientManager GET: https://api.themoviedb.org/3/movie/tt3733778?api_key=f6bd687ffa63cd282b6ff2c6877f2669&append_to_response=casts,releases,images,keywords,trailers&language=en&include_image_language=en,null
2016-10-16 15:26:00.7872 Debug ProviderManager: Saving \\netdrv\movies\PAY_THE_GHOST_(2015) to Nfo.
2016-10-16 15:26:02.0833 Debug App: Saving \\netdrv\movies\PAY_THE_GHOST_(2015) to database.

 

I noticed that the scan is still running an ffprobe, movienfo, omdb check etc on every movie in the media library.

 

2) I was under the impression that once the initial scan had been completed at some point and the nfo files generated, the scanner would not need to do a web search for each movie if it already had the relevant data in a local nfo file.

  • Does the the library scanner actually use the nfo data to populate the library.db file or is it the other way around?
  • Is the web search checking for new data in case maybe the web metadata for a particular movie such as plot, actors etc has changed?
  • Would this metadata search/update be prevented by locking a movie profile in the nfo?
  • Besides maybe pulling the network cable, is there a way to make this process faster so that the scan uses the local nfo data that is already available rather than new web searches?

 

I hope these are not too many questions at once. Thanks for a greatly flexible media center solution.

 

 

 

 

 

Posted (edited)

Has anyone got any input on this? Did I break a few house rules or something?

Edited by carpediem
PenkethBoy
Posted (edited)

Hi

 

A lot of information about file locations etc are in the library database (if you want to have a look just downlaod a sqllite browser application) - if you undrstand sql and the db scheme you could attempt to edit the records 

 

But to be honest deleting the library db and rescanning is the easiest option

 

As for metadata - yes you have a nfo with your data but if you open one up in a text editor its mainly the text you see in metadata browser - whats not contained is for example the chapter images - as you deleted the db - emby has no knowledge of what was before so thinks the movie are new and does the necessary

 

2) a) There is an order of precedence for metadata - so if it exists then its used but i believe checked against the internet - because there could be additions - it wont delete anything - so if say you have a movie title incorrectly spelt it wont overwrite it etc - as chaos would result - Luke/Ebr are the best to define what the order is etc

2) B) yep see above

2) c) Dont know - give it a go

2) d) The first scan is obviously the longest but after that its a few minutes each day - so dont see the point just let it run - sometimes the providers are down and you will not get all the data the first time. Also people images are downloaded as needed not in advance so as you go through your movies there will be other time it goes to the internet

 

Unless you have a metered connection or it very slow the bandwidth emby uses is small - so generally not an issue.

Edited by PenkethBoy
  • Like 1

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