killride 45 Posted April 21, 2020 Share Posted April 21, 2020 Hi guys, I would like to do a fancy dashboard displaying the most viewed Film and Series of the week. Do you know if we can do this through the API? Thanks in advance. Jim Link to comment Share on other sites More sharing options...
Luke 37054 Posted April 22, 2020 Share Posted April 22, 2020 You can't for just the week but you can sort media on play count, if that helps. Link to comment Share on other sites More sharing options...
killride 45 Posted April 22, 2020 Author Share Posted April 22, 2020 Yes, I will have a look on this. So I get the full list and sort it by playcount Link to comment Share on other sites More sharing options...
killride 45 Posted April 22, 2020 Author Share Posted April 22, 2020 (edited) xxxxxx:8096/emby/items?SortBy=PlayCount&api_key=xxxxxxxx&Recursive=true&IncludeItemTypes=Movie doesn't work I have this error : Exception of type 'SQLitePCL.pretty.SQLiteException' was thrown. xxxxxxx:8096/emby/items?SortBy=Random&api_key=xxxxxxxxxxxx&Recursive=true&IncludeItemTypes=Movie Works Any idea why? Am I doing something wrong? Edited April 22, 2020 by killride Link to comment Share on other sites More sharing options...
Luke 37054 Posted April 22, 2020 Share Posted April 22, 2020 And the details? Link to comment Share on other sites More sharing options...
killride 45 Posted April 23, 2020 Author Share Posted April 23, 2020 which details? server log? Link to comment Share on other sites More sharing options...
killride 45 Posted April 23, 2020 Author Share Posted April 23, 2020 2020-04-23 07:30:35.524 Info HttpServer: HTTP GET http://192.168.1.254:8096/emby/items?Recursive=true&Limit=10&IncludeItemTypes=Series&SortBy=PlayCount. UserAgent: PostmanRuntime/7.24.1 2020-04-23 07:30:35.539 Error HttpServer: Error processing request *** Error Report *** Version: 4.4.2.0 Command line: C:\EmbyV3\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:/EmbyV3/system/System.Private.CoreLib.dll System.Environment.Version: 3.1.3 Processor count: 8 Program data path: C:\EmbyV3\programdata Application directory: C:\EmbyV3\system SQLitePCL.pretty.SQLiteException: Error: no such column: UserDatas.PlayCount - select A.Id,A.Name,A.RunTimeTicks,A.guid,A.ParentId,A.Images from MediaItems A where type=@@type ORDER BY UserDatas.PlayCount ASC LIMIT 10 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 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) Link to comment Share on other sites More sharing options...
PenkethBoy 2063 Posted April 23, 2020 Share Posted April 23, 2020 You need to use the ../emby/users/<userId>/items endpoint As playcount is user specific - where random is not Adding in the userId and it works fine Link to comment Share on other sites More sharing options...
killride 45 Posted April 23, 2020 Author Share Posted April 23, 2020 But playcount will count the amond of played from every users right? Link to comment Share on other sites More sharing options...
PenkethBoy 2063 Posted April 23, 2020 Share Posted April 23, 2020 No - for the user you supply as the playcount is user specific Link to comment Share on other sites More sharing options...
killride 45 Posted April 23, 2020 Author Share Posted April 23, 2020 So it's useless. Link to comment Share on other sites More sharing options...
PenkethBoy 2063 Posted April 23, 2020 Share Posted April 23, 2020 no its not Explain what you want in detail so we have a chance to understand better what you are trying to do And why cant you combine the results of each user to get a total count per movie/epsiode etc Link to comment Share on other sites More sharing options...
killride 45 Posted April 24, 2020 Author Share Posted April 24, 2020 I would like to do a web page displaying the top 10 most viewed movies and TV shows Link to comment Share on other sites More sharing options...
PenkethBoy 2063 Posted April 24, 2020 Share Posted April 24, 2020 Well what i would do is... Query Emby for each user - to get playcounts Combine those results and use the info to find the 10 top for Movies and Episodes which can be translated into Series If you are expecting a single command to do this then you are going to be disappointed Link to comment Share on other sites More sharing options...
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