cd01 8 Posted October 13, 2022 Posted October 13, 2022 (edited) I have been using curl to setup my scans because it gives me more granular control of when and where and how things are scanned, having a massive library i dont trust "real time monitoring" to leave my disks performance at ease if it is looking for changes all the time in a massive library. I noticed now that scans have stopped working, and i realize too i no longer can find the libraries unique guid via the url in the web app anymore. Please advise how i use curl to scan my libraries since recent changes? How can i find the unique selector and what is the new commands, old command that worked for years: Quote curl "http://192.168.2.33:8096/emby/Items/3c2528d8a649782bb603540310f2b35a/Refresh?Recursive=true&ImageRefreshMode=FullRefresh&MetadataRefreshMode=FullRefresh&ReplaceAllImages=false&ReplaceAllMetadata=false&api_key=xxxxxxxxxxxxxxxxx" Where as 3c2528d8a649782bb603540310f2b35a was the unique id for this specific library, i believe i could get these via the url when using the web app but when i go there now and enter the library it only shows "serverid" which isn't what i need. Edited October 13, 2022 by cd01
Luke 42077 Posted October 13, 2022 Posted October 13, 2022 HI, when you enter the library in the web app, you should see the parentId param. Try that.
cd01 8 Posted October 13, 2022 Author Posted October 13, 2022 3 minutes ago, Luke said: HI, when you enter the library in the web app, you should see the parentId param. Try that. Ok, but how would i format the curl string? replacing the items/xxxxxxxxxxxxxxxguidxxx/ with the parentid which is in this case just 35 didn't work example: Quote curl "http://192.168.2.33:8096/emby/Items/35/Refresh?Recursive=true&ImageRefreshMode=FullRefresh&MetadataRefreshMode=FullRefresh&ReplaceAllImages=false&ReplaceAllMetadata=false&api_key=xxxxxxxxxxxxxxxxx"
Luke 42077 Posted October 13, 2022 Posted October 13, 2022 The same way. You'd just use that new id value in the same way you were using the guid before.
Luke 42077 Posted October 13, 2022 Posted October 13, 2022 1 minute ago, cd01 said: Ok, but how would i format the curl string? replacing the items/xxxxxxxxxxxxxxxguidxxx/ with the parentid which is in this case just 35 didn't work example: Try going to emby library setup and doing it from there with the 3-dot menu over a library. You can monitor the request in the browser debugger network tab. It does the same thing, and it works just fine. That might help you spot a difference.
Happy2Play 9780 Posted October 13, 2022 Posted October 13, 2022 Isn't it incomplete command? Quote curl -X POST "http://localhost:8096/emby/Items/390537/Refresh?Recursive=true&ImageRefreshMode=Default&MetadataRefreshMode=Default&ReplaceAllImages=false&ReplaceAllMetadata=false?api_key=YOURAPIKEY" -d ""
cd01 8 Posted October 13, 2022 Author Posted October 13, 2022 seems to be something else wrong, checking logs, ideas? Quote 022-10-13 23:42:11.786 Error ProviderManager: Error refreshing item *** Error Report *** Version: 4.7.8.0 Command line: /app/emby/EmbyServer.dll -programdata /config -ffdetect /app/emby/ffdetect -ffmpeg /app/emby/ffmpeg -ffprobe /app/emby/ffprobe -restartexitcode 3 Operating system: Linux version 5.15.46-Unraid (root@Develop) (gcc (GCC) 11.2.0, GNU ld version 2.37-slack15) #1 SMP Fri Jun 10 11:08:41 PDT 2022 Framework: .NET 6.0.8 OS/Process: x64/x64 Runtime: app/emby/System.Private.CoreLib.dll Processor count: 32 Data path: /config Application path: /app/emby SQLitePCL.pretty.SQLiteException: Error: cannot rollback - no transaction is active SQLitePCL.pretty.SQLiteException: Exception of type 'SQLitePCL.pretty.SQLiteException' was thrown. at SQLitePCL.pretty.SQLiteException.CheckOk(sqlite3 db, Int32 rc) at SQLitePCL.pretty.StatementImpl.MoveNext() at SQLitePCL.pretty.DatabaseConnection.Execute(IDatabaseConnection This, ReadOnlySpan`1 sqlUtf8) at SQLitePCL.pretty.DatabaseConnection.RollbackTransaction(IDatabaseConnection This) at Emby.Server.Implementations.Data.SqliteItemRepository.SaveItems(List`1 items, MetadataRefreshOptions metadataRefreshOptions, Action`1 afterSave, CancellationToken cancellationToken) at Emby.Server.Implementations.Data.SqliteItemRepository.SaveItems(List`1 items, MetadataRefreshOptions metadataRefreshOptions, CancellationToken cancellationToken) at Emby.Server.Implementations.Library.LibraryManager.UpdateItems(List`1 items, BaseItem parent, ItemUpdateType updateReason, Boolean setDateLastSaved, Boolean saveMetadata, MetadataRefreshOptions metadataRefreshOptions, CancellationToken cancellationToken) at Emby.Server.Implementations.Library.LibraryManager.UpdateItems(List`1 items, BaseItem parent, ItemUpdateType updateReason, MetadataRefreshOptions metadataRefreshOptions, CancellationToken cancellationToken) at Emby.Server.Implementations.Library.LibraryManager.UpdateItem(BaseItem item, BaseItem parent, ItemUpdateType updateReason, MetadataRefreshOptions metadataRefreshOptions) at MediaBrowser.Controller.Entities.BaseItem.UpdateToRepository(ItemUpdateType updateReason, MetadataRefreshOptions metadataRefreshOptions) at Emby.Providers.Manager.MetadataService`2.SaveItem(MetadataResult`1 result, Boolean isFirstRefresh, LibraryOptions libraryOptions, ItemUpdateType reason, IDirectoryService directoryService, MetadataRefreshOptions metadataRefreshOptions, CancellationToken cancellationToken) at Emby.Providers.Manager.MetadataService`2.RefreshMetadata(BaseItem item, MetadataRefreshOptions refreshOptions, LibraryOptions libraryOptions, CancellationToken cancellationToken) at MediaBrowser.Controller.Entities.BaseItem.RefreshMetadata(MetadataRefreshOptions options, LibraryOptions libraryOptions, CancellationToken cancellationToken) at Emby.Providers.Manager.ProviderManager.RefreshItem(BaseItem item, MetadataRefreshOptions options, CancellationToken cancellationToken) at Emby.Providers.Manager.ProviderManager.StartProcessingRefreshQueue() Source: SQLitePCL.pretty TargetSite: Void CheckOk(SQLitePCLEx.sqlite3, Int32)
cd01 8 Posted October 13, 2022 Author Posted October 13, 2022 looks like the entire library.db has gone corrupt, perhaps thats why it stopped working, does old guids still work or do they need to be parentid? no reason to update all the crons if its just db corruption that caused all the issue
Happy2Play 9780 Posted October 13, 2022 Posted October 13, 2022 Is that the only sql error? Have you tried restarting the host system?
cd01 8 Posted October 13, 2022 Author Posted October 13, 2022 (edited) 9 minutes ago, Happy2Play said: Is that the only sql error? Have you tried restarting the host system? Restart not helping, i didnt realize it was corrupt for a while so my backups jobs have saved a corrupt image too, this is bad.. fuck me SQLitePCL.pretty.SQLiteException: Corrupt: database disk image is malformed I really dislike you save the library settings in the database now i have to manually reconfigure everything, these settings should really be in its own little file away from this sqllite bs Edited October 13, 2022 by cd01
Happy2Play 9780 Posted October 13, 2022 Posted October 13, 2022 2 minutes ago, cd01 said: Restart not helping, i didnt realize it was corrupt for a while so my backups jobs have saved a corrupt image too, this is bad.. fuck me SQLitePCL.pretty.SQLiteException: Corrupt: database disk image is malformed I really dislike you save the library settings in the database now i have to manually reconfigure everything, these settings should really be in its own little file away from this sqllite bs Unfortunately with a malformed db you have to rebuild Steps to Reset Library Database You could try to recover with other steps in kb. 1
cd01 8 Posted October 13, 2022 Author Posted October 13, 2022 thanks will try it tomorrow, i have a backup that is almost half a year old i can try too, worst case i have to remap all the shares and stuff which is something i really want to avoid, anyways i think this explains why emby suddenly stopped updating, it took awhile for me to realise this, i have been waiting for weeks for house of the dragon episode 6, and now i looked manually on the actual share emby was reading and it is episode 8 out... so i was like what the hell, anyway, thanks for the support, good night for now 1
Solution cd01 8 Posted October 14, 2022 Author Solution Posted October 14, 2022 (edited) Just wanted to say i had a backup in a fireproof safe which i do in case of absolute emergencies and this backup had a emby database from 3 months ago, i replaced with this one and it works, thanks for the help guys, remember to have many backups EDIT: All seems to work, but i am worried that emby may have changed some tables in the db that only gets added/modified upon updating emby, time will tell if things continue to work properly or if i eventually run into trouble. Edited October 14, 2022 by cd01 1
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now