Jump to content

SQLiteException on /Items when using MinDateLastSavedForUser


Montellese

Recommended Posts

Montellese

I'm trying to use the "MinDateLastSaved" and "MinDateLastSavedForUser" filters on the /Items endpoint. The former works perfectly fine but as soon as a specify the latter (with or without the former) I always get an HTTP 500 error code with the following response body:

Exception of type 'SQLitePCL.pretty.SQLiteException' was thrown.

I then checked the Emby server logs and found the following:

2020-01-25 11:10:07.809 Info HttpServer: HTTP GET http://localhost:8097/emby/Items?MinDateLastSavedForUser=2020-01-20T00:00:00&ParentId=f137a2dd21bbc1b99aa5c0f6bf02a805&IncludeItemTypes=Movie. UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36
2020-01-25 11:10:07.811 Error HttpServer: Error processing request
	*** Error Report ***
	Version: 4.3.1.0
	Command line: C:\Users\XXX\AppData\Roaming\Emby-Server\system\EmbyServer.dll
	Operating system: Microsoft Windows NT 6.2.9200.0
	64-Bit OS: True
	64-Bit Process: True
	User Interactive: True
	Runtime: file:///C:/Users/XXX/AppData/Roaming/Emby-Server/system/System.Private.CoreLib.dll
	Processor count: 8
	Program data path: C:\Users\XXX\AppData\Roaming\Emby-Server\programdata
	Application directory: C:\Users\XXX\AppData\Roaming\Emby-Server\system
	SQLitePCL.pretty.SQLiteException: Error: no such column: RatingLastModified - select A.Id,A.Name,A.RunTimeTicks,A.guid,A.ParentId,A.Images from MediaItems A where type=@[member="type"] AND ParentId=@ParentId AND ((DateLastSaved not null and DateLastSaved>=@MinDateLastSavedForUser) or (RatingLastModified not null and RatingLastModified>=@MinDateLastSavedForUser) or (PlaystateLastModified not null and PlaystateLastModified>=@MinDateLastSavedForUser))
	SQLitePCL.pretty.SQLiteException: Exception of type 'SQLitePCL.pretty.SQLiteException' was thrown.
	   at SQLitePCL.pretty.SQLiteDatabaseConnection.PrepareStatement(String sql, String& tail)
	   at SQLitePCL.pretty.DatabaseConnection.PrepareStatement(IDatabaseConnection This, String sql)
	   at Emby.Server.Implementations.Data.SqliteItemRepository.QueryItemsInTransaction[T](InternalItemsQuery query, IDatabaseConnection db, String[] columnsToSelect, Func`5 rowReaderFn, Boolean singleResult, String methodName)
	   at Emby.Server.Implementations.Data.SqliteItemRepository.GetItems(InternalItemsQuery query)
	   at Emby.Server.Implementations.Library.LibraryManager.GetItemsResult(InternalItemsQuery query)
	   at MediaBrowser.Controller.Entities.Folder.GetItemsInternal(InternalItemsQuery query)
	   at MediaBrowser.Controller.Entities.CollectionFolder.GetItemsInternal(InternalItemsQuery query)
	   at MediaBrowser.Controller.Entities.Folder.GetItems(InternalItemsQuery query)
	   at MediaBrowser.Api.UserLibrary.ItemsService.GetQueryResult(GetItems request, DtoOptions dtoOptions, User user)
	   at MediaBrowser.Api.UserLibrary.ItemsService.GetItems(GetItems request)
	   at MediaBrowser.Api.UserLibrary.ItemsService.Get(GetItems request)
	   at Emby.Server.Implementations.Services.ServiceController.Execute(HttpListenerHost appHost, Object requestDto, IRequest req)
	   at Emby.Server.Implementations.Services.ServiceHandler.ProcessRequestAsync(HttpListenerHost appHost, IRequest httpReq, IResponse httpRes, RestPath restPath, String responseContentType, CancellationToken cancellationToken)
	   at Emby.Server.Implementations.HttpServer.HttpListenerHost.RequestHandler(IRequest httpReq, ReadOnlyMemory`1 urlString, ReadOnlyMemory`1 localPath, CancellationToken cancellationToken)
	Source: SQLitePCL.pretty
	TargetSite: SQLitePCL.pretty.IStatement PrepareStatement(System.String, System.String ByRef)
	
2020-01-25 11:10:07.811 Info HttpServer: HTTP Response 500 to ::1. Time: 2ms. http://localhost:8097/emby/Items?MinDateLastSavedForUser=2020-01-20T00:00:00&ParentId=f137a2dd21bbc1b99aa5c0f6bf02a805&IncludeItemTypes=Movie

So it looks like the SQL query is trying to filter on the column "RatingLastModified" which doesn't exist.

 

I tried both from my own code and with Swagger (the log above is from a Swagger request).

 

PS: Would it be supported to combine "MinDateLastSaved" and "MinDateLastSavedForUser" in the same request or do I have to perform two separate requests?

 

Thanks for your support.

Link to comment
Share on other sites

Hi, yes it would be supported to combine the params. I'll look into why that column might not be there. Thanks.

Link to comment
Share on other sites

  • 2 weeks later...

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