Jump to content

Test - Trakt List To Collections


Recommended Posts

zerodayz
Posted

Thanks for the debug version @bakes82Here are my findings with this release. 

The log output is attached, showing all the items in the library. It does not return any IMDB IDs for the movies. 

However, if I check via the API, I do see that the item contains the IMDB entry:

 

  'http://emby:8096/emby/Items?Fields=ProviderIds&Ids=212572&api_key=xxxxx' \
  -H 'accept: application/json'

{
    "Items": [{
        "Name": "Captain America: The First Avenger",
        "ServerId": "9894eb512bb74059bc24bfd4733a75f0",
        "Id": "212572",
        "RunTimeTicks": 74516110000,
        "ProviderIds": {
            "Tmdb": "1771",
            "Imdb": "tt0458339",
            "Tvdb": "180",
            "EIDR": "10.5240/FA52-C2FE-11F3-23CB-99DC-V",
            "Official Website": "http://captainamerica.marvel.com/"
        },
        "IsFolder": false,
        "Type": "Movie",
        "ImageTags": {
            "Primary": "f828b0d5c4d2483a1e54eb04bb8797c2",
            "Art": "11572bcee61383e9b6c6193d205b07c2",
            "Banner": "eea7307daf4571d68d30925d9fc337fa",
            "Logo": "e52d881f896f317c1fa4eb241c5a205c",
            "Thumb": "9affbcd9e12d0a7deec24bab5f7f244d"
        },
        "BackdropImageTags": ["e509fab4610d6d21c675877f90513116"],
        "MediaType": "Video"
    }],
    "TotalRecordCount": 1
} 


As can also be seen in the GUI for this item:
 

image.png.417a2a142de17babb6f4e0d1db6c1188.png

Thanks for continuing to look into this.

 

trakt_log_zerodayz.txt

  • Like 1
sh0rty
Posted

@rbjtech @bakes82 @Luke

API query seems right, all IDs are there. Example Shawshank Redemption again:

curl -X "GET" "http://127.0.0.1/emby/Items?Fields=ProviderIds&Ids=349484&api_key=XXX" -H "accept: application/json"

{"Items":[
	{"Name":"Die Verurteilten",
	"ServerId":"14d786b2660149e198d5304a00316237",
	"Id":"349484",
	"RunTimeTicks":85525770000,
	"ProviderIds":{
	  "Tmdb":"278",
	  "Imdb":"tt0111161"
	},
	"IsFolder":false,
	"Type":"Movie",
	"ImageTags":{
	  "Primary":"4c6899a7997cb6bb6b44959a6c6e9628",
	  "Art":"1286f8d48bf468a7627127351454b48b",
	  "Banner":"f1ca332e53617dea92491019c31683cc",
	  "Disc":"628c1076e1bcadbad8cd4cc960ef698c",
	  "Logo":"2d07d105e852acc7343ca7dbd6954207",
	  "Thumb":"4d09e09fa1b42f5d373d689908eb3598"
	},
	"BackdropImageTags":[
	  "56c86bfebc46aa72b3c6bf2ece356d10",
	  "de6afc797998cc8f82f5b57b27e42389",
	  "774eb31db3836962ae29a9a9c39203ed",
	  "c8bf6d669417625b3eb6f84b9062cfe2",
	  "339755166afa3dfc3072acdfc1cb9ca0"
	],
	"MediaType":"Video"
   }
  ],
  "TotalRecordCount":1
}

 

bakes82
Posted
6 hours ago, rbjtech said:

I suspect you will not - which is why it is not finding anything...

They both said it works fine for Series though and their logs show ids for series, its odd lol, and the SDK should be the driving factor since its only targeting 4.8.5.

  • Like 1
sh0rty
Posted (edited)

Fun fact: I have a library declared as mixed content with Concerts. I ran a trakt Concert movie list against it with the plugin and it works.
In the API call or NFOs is nothing different compared to the movie library which is not working.

 

Edited by shorty1483
sh0rty
Posted

Any news on this? 😨

bakes82
Posted
29 minutes ago, shorty1483 said:

Any news on this? 😨

Nope. I’m not looking in to anything. If it works for other people on same version and you’ve confirmed it works with every other library format not sure what the specific issue is as the code is generic.  Would need @Lukeor someone to tell you what the issue is.  What if you put the “movies” in to the mixed library, make a new library for movies, fire up a new test instance?

sh0rty
Posted (edited)

Sure because every other library is not labeled as a movie library.

I wanted to exclude errors caused by the several server upgrades the last years that could affect the library. 
So I made a test library from scratch labeled as movie library. No dice. Plugin finds the test movie, but no IMDB or TMDB ID. Then I set up a test run with NFO turned off as info storage also with no luck.

Created same library as mixed content, IMDB and TMDB found. 

@rbjtechIs your working library mixed content?

@LukeIt would be really nice if you have a suggestion what the culprit could be before I would need to put all my stuff into a mixed content library following by a neverending scan time. Thanks! With mixed content, it seems I would loose additional headers/presentation like a Movie library would do.

Edited by shorty1483
bakes82
Posted

@shorty1483 I just tested on my synology nas 4.8.8.0 docker -

Its pulling Ids correctly in the debug version that loops all the media items.  The movies library is just a stock new movies library, then add folders, scan.

2024-07-04 18:06:16.659 Info TaskManager: Executing Create Collections From Trakt Lists
2024-07-04 18:06:16.672 Info TraktListCollectionsCreateCollectionsTask: Library Movies ID: 6 Type: movies
2024-07-04 18:06:16.675 Info HttpClient: GET https://api.trakt.tv/users/donxy/lists/marvel-cinematic-universe/items/movie
2024-07-04 18:06:16.945 Info TraktListCollectionsCreateCollectionsTask: Count of Trakt list items = 49
2024-07-04 18:06:16.949 Info TraktListCollectionsCreateCollectionsTask: Items found in library: 7
2024-07-04 18:06:16.949 Info TraktListCollectionsCreateCollectionsTask: Title: Wednesday /media/TV/Wednesday (2022) :: IMDB: tt13443470 - TVDB: 397060
2024-07-04 18:06:16.949 Info TraktListCollectionsCreateCollectionsTask: Title: Moonshot /media/Movies/Moonshot (2022) - x264 EAC3 Atmos 5.1 CMRG WEBDL-1080p {tt12585076}.mkv :: IMDB: tt12585076 - TVDB: 
2024-07-04 18:06:16.949 Info TraktListCollectionsCreateCollectionsTask: Title: The Contractor /media/Movies/The Contractor (2022) - h264 EAC3 5.1 AMZN EVO WEBDL-1080p {tt10323676}.mkv :: IMDB: tt10323676 - TVDB: 
2024-07-04 18:06:16.949 Info TraktListCollectionsCreateCollectionsTask: Title: 2 Fast 2 Furious /media/Movies/2 Fast 2 Furious (2003) - x265 DTS-X HDR 7.1 PHOCiS Bluray-2160p {tt0322259} - Copy.mkv :: IMDB: tt0322259 - TVDB: 
2024-07-04 18:06:16.949 Info TraktListCollectionsCreateCollectionsTask: Title: 2 Fast 2 Furious /media/Movies/2 Fast 2 Furious (2003) - x265 DTS-X HDR 7.1 PHOCiS Bluray-2160p {tt0322259}.mkv :: IMDB: tt0322259 - TVDB: 
2024-07-04 18:06:16.949 Info TraktListCollectionsCreateCollectionsTask: Title: 100 Day Dream Home Beachfront Hotel (2023) /media/TV/100 Day Dream Home Beachfront Hotel (2023) :: IMDB:  - TVDB: 
2024-07-04 18:06:16.949 Info TraktListCollectionsCreateCollectionsTask: Title: Howard_Stern /media/Audio/Howard_Stern :: IMDB:  - TVDB: 

 

Posted
7 hours ago, shorty1483 said:


@LukeIt would be really nice if you have a suggestion what the culprit could be before I would need to put all my stuff into a mixed content library following by a neverending scan time. Thanks! With mixed content, it seems I would loose additional headers/presentation like a Movie library would do.

I don't think the content type of the library matters. That's just the only difference that we know of right now but I think something else is the issue and it will require more debugging.

adminExitium
Posted

Any possibility it's the CollapseSingleItemFolders setting (due to being older setups) and the plugin may be reading the folder item rather than the actual media item?

rbjtech
Posted
13 hours ago, shorty1483 said:

@rbjtechIs your working library mixed content?

I don't have any mixed content libraries other than TV Recording, and that won't have any collections items anyway.

Both TV and Movie/Film are both working fine for me, even on the first release.

sh0rty
Posted
3 hours ago, adminExitium said:

Any possibility it's the CollapseSingleItemFolders setting (due to being older setups) and the plugin may be reading the folder item rather than the actual media item?

<CollapseVideoFolders> in System.xml and <CollapseSingleItemFolders> in Options.xml for my Movie library are set to false.

adminExitium
Posted

You may want to try a fresh install with a small subet of your library and the CollapseVideoFolders set to true in System.xml (which overrides any library specific setting), which should already be the default in new installations, if I am not wrong. This has flip-flopped a few times over the years, so I always ensure it's set to true manually in any installs that I do myself.

sh0rty
Posted
38 minutes ago, adminExitium said:

You may want to try a fresh install with a small subet of your library and the CollapseVideoFolders set to true in System.xml (which overrides any library specific setting), which should already be the default in new installations, if I am not wrong. This has flip-flopped a few times over the years, so I always ensure it's set to true manually in any installs that I do myself.

But the other libraries where the plugin works have the same setting (false).

bakes82
Posted
8 hours ago, adminExitium said:

plugin may be reading the folder item rather than the actual media item

Do explain, because the code is posted above and its using methods exposed via the SDK lol so that would mean the SDK is doing something different based on whatever this xml flag is not "the plugin" and its only doing it differently for items in the libraries marked as "Movies".

  • Agree 1
rbjtech
Posted

FYI Mine says -

<CollapseVideoFolders>true</CollapseVideoFolders>

 

Posted
2 hours ago, bakes82 said:

Do explain, because the code is posted above and its using methods exposed via the SDK lol so that would mean the SDK is doing something different based on whatever this xml flag is not "the plugin" and its only doing it differently for items in the libraries marked as "Movies".

I think the first thing to find out via debugging is whether your database query is coming up empty, or whether it's returning results and then your higher level code is filtering them out. That should help narrow things down.

bakes82
Posted
23 minutes ago, Luke said:

I think the first thing to find out via debugging is whether your database query is coming up empty, or whether it's returning results and then your higher level code is filtering them out. That should help narrow things down.

@LukeCode and logs are already posted above.  It is showing it getting media items, and looping them, it's just doing a console log, also it works fine on my system.  So, I don't have the issue.  Nothing is being "filtered" out its just doing a GetProviderId on each item, the results come back empty for his movies, I attached his logs, he runs the same thing for a Series library, and it works fine.  I would output each item as json but most of the items are marked to not serialize.  He has also shown the rest api comes back with providerIds 

image.thumb.png.c64433e18ef7a50b6ac4575f0c5d0d20.png

image.thumb.png.024070d3c53ec1ea6d90a8b59595a22a.png

 

@shorty1483I added another "log" to see if the ProviderIds is empty if not empty to loop those also if you want to give it whirl.  

image.thumb.png.5cddd3acf1c9332c7d382c145060d896.png

log.txt Emby.TraktListCollections.dll

Posted
5 minutes ago, bakes82 said:

@LukeCode and logs are already posted above.  It is showing it getting media items, and looping them, it's just doing a console log, also it works fine on my system.  So, I don't have the issue.  Nothing is being "filtered" out its just doing a GetProviderId on each item, the results come back empty for his movies, I attached his logs, he runs the same thing for a Series library, and it works fine.  I would output each item as json but most of the items are marked to not serialize.  He has also shown the rest api comes back with providerIds 

image.thumb.png.c64433e18ef7a50b6ac4575f0c5d0d20.png

image.thumb.png.024070d3c53ec1ea6d90a8b59595a22a.png

 

@shorty1483I added another "log" to see if the ProviderIds is empty if not empty to loop those also if you want to give it whirl.  

image.thumb.png.5cddd3acf1c9332c7d382c145060d896.png

log.txt 297.02 kB · 0 downloads Emby.TraktListCollections.dll 137 kB · 0 downloads

Right, so if it is working fine on your system but not his, then more logging will be required to find out why. For example, what are the results of the database query on his system? Were all of his movies found? Were any not found? Do all of his movies contain the required data that your code needs in order to process them (e.g. provider ids)? Are any missing that data? What does the code do if some are missing that data? Does the log answer all of these questions?

I haven't debugged it myself. These are just generalized pointers that I think will help you find out what's going on. It's what I would start with if I were working on it myself.

bakes82
Posted
1 hour ago, Luke said:

Right, so if it is working fine on your system but not his, then more logging will be required to find out why. For example, what are the results of the database query on his system? Were all of his movies found? Were any not found? Do all of his movies contain the required data that your code needs in order to process them (e.g. provider ids)? Are any missing that data? What does the code do if some are missing that data? Does the log answer all of these questions?

I haven't debugged it myself. These are just generalized pointers that I think will help you find out what's going on. It's what I would start with if I were working on it myself.

Right so you've clearly not looked at the thread history - Not sure what my process has to do with anything when they key piece we are talking about is the segment of code posted which  is proving the point that the GetProviderIds is returning null data, even though he has posted screen shots of the data in the SQL table, he also posted rest api to get items with providerId and it returns with providerIds.  He runs the the SAME code for a series library and he DOES get results.  So clearly the code is working correctly, regardless, so at this point what more logging do you want to see?  I could understand if the lookup logic was having issues matching, but weve ruled that out and we arent even getting to that point, hence why I added the logging to loop over the "mediaitems" to see yes the dataset comes back, no GetProviderId(Imdb) is returned, but OP has posted screen shot of DB/UI/RestCall showing that the data is there, so now the question goes back to you, what do you want them to see?  What if I just make a new SchedTask plugin with just the get media items and the loop and it doesnt return back providerids for movies.

I believe when I had this code (searchType = nameof(Movie), it was returning back 0 items for him, so does that mean anything, nameof(Series) did return back items), removing the IncludeItemsTypes is atleat now returning back items, still no providerIds), the nameof(Movie) worked on my machine and rb just not these other two.  Is there another way to get items out with the providerIds?

mediaItems = _libraryManager.GetItemList(new InternalItemsQuery
                                                             {
                                                                 IncludeItemTypes = new[]
                                                                                    {
                                                                                        searchType
                                                                                    },
                                                                 IsVirtualItem = false,
                                                                 ParentIds = new[]
                                                                             {
                                                                                 long.Parse(collection.LibraryId)
                                                                             },
                                                                 OrderBy = new[]
                                                                           {
                                                                               new ValueTuple<string, SortOrder>(ItemSortBy.PremiereDate, SortOrder.Descending),
                                                                               new ValueTuple<string, SortOrder>(ItemSortBy.SeriesSortNameOrSortName, SortOrder.Ascending)
                                                                           }
                                                             })
                                                .ToList();

 

  • Thanks 2
sh0rty
Posted (edited)

 

2 hours ago, bakes82 said:

@shorty1483I added another "log" to see if the ProviderIds is empty if not empty to loop those also if you want to give it whirl.  

image.thumb.png.5cddd3acf1c9332c7d382c145060d896.png

log.txt 297.02 kB · 0 downloads Emby.TraktListCollections.dll 137 kB · 1 download

Still not working. But thanks for you commitment to make it work. But let it be, it seems to work for most of the people and I'm pretty sure your code is OK. 
Sometimes I think the real Luke coded a chatbot who writes under his name in this forum. It was like that before I left the forum for some time, and I learned today that some things will never change.

 

1 hour ago, Luke said:

Right, so if it is working fine on your system but not his, then more logging will be required to find out why. For example, what are the results of the database query on his system? Were all of his movies found? Were any not found? Do all of his movies contain the required data that your code needs in order to process them (e.g. provider ids)? Are any missing that data? What does the code do if some are missing that data? Does the log answer all of these questions?

I haven't debugged it myself. These are just generalized pointers that I think will help you find out what's going on. It's what I would start with if I were working on it myself.

Wow. Simply wow. Period. Annoying that very often people upload their server logs and problem related stuff just for you to ask them to upload their server logs and problem related stuff. Again. Database screenshot with the needed IDs and an API query returning the IDs are in this thread.

 

log (2).txt

Edited by shorty1483
Posted
26 minutes ago, bakes82 said:

Right so you've clearly not looked at the thread history - Not sure what my process has to do with anything when they key piece we are talking about is the segment of code posted which  is proving the point that the GetProviderIds is returning null data, even though he has posted screen shots of the data in the SQL table, he also posted rest api to get items with providerId and it returns with providerIds.  He runs the the SAME code for a series library and he DOES get results.  So clearly the code is working correctly, regardless, so at this point what more logging do you want to see?  I could understand if the lookup logic was having issues matching, but weve ruled that out and we arent even getting to that point, hence why I added the logging to loop over the "mediaitems" to see yes the dataset comes back, no GetProviderId(Imdb) is returned, but OP has posted screen shot of DB/UI/RestCall showing that the data is there, so now the question goes back to you, what do you want them to see?  What if I just make a new SchedTask plugin with just the get media items and the loop and it doesnt return back providerids for movies.

I believe when I had this code (searchType = nameof(Movie), it was returning back 0 items for him, so does that mean anything, nameof(Series) did return back items), removing the IncludeItemsTypes is atleat now returning back items, still no providerIds), the nameof(Movie) worked on my machine and rb just not these other two.  Is there another way to get items out with the providerIds?

mediaItems = _libraryManager.GetItemList(new InternalItemsQuery
                                                             {
                                                                 IncludeItemTypes = new[]
                                                                                    {
                                                                                        searchType
                                                                                    },
                                                                 IsVirtualItem = false,
                                                                 ParentIds = new[]
                                                                             {
                                                                                 long.Parse(collection.LibraryId)
                                                                             },
                                                                 OrderBy = new[]
                                                                           {
                                                                               new ValueTuple<string, SortOrder>(ItemSortBy.PremiereDate, SortOrder.Descending),
                                                                               new ValueTuple<string, SortOrder>(ItemSortBy.SeriesSortNameOrSortName, SortOrder.Ascending)
                                                                           }
                                                             })
                                                .ToList();

 

You should add the InternalId property to the log statement. This will help you verify that the records you're logging about are the same ones that he's showing in his sql result.

Posted
9 minutes ago, shorty1483 said:

 

Still not working. But thanks for you commitment to make it work. But let it be, it seems to work for most of the people and I'm pretty sure your code is OK. 
Sometimes I think the real Luke coded a chatbot who writes under his name in this forum. It was like that before I left the forum for some time, and I learned today that some things will never change.

 

Wow. Simply wow. Period. Annoying that very often people upload their server logs and problem related stuff just for you to ask them to upload their server logs and problem related stuff. Again.

 

log (2).txt 297.23 kB · 1 download

Again I have not personally debugged this, so short of me doing that I'm still trying to help by providing generalized tips of how I would start. Yes you provided the log, but what I'm suggesting is that the plugin needs to write more to the log. When you have theories about what the issue might be, the logging can help you prove them.

bakes82
Posted

@shorty1483 I added InternalId, I guess he wants you to verify in DB/rest/log that they all are the same or something before he says what he says what he thinks the issue is.

 

2024-07-06 06:41:11.221 Info TraktListCollectionsCreateCollectionsTask: Internal Id 1377559 :: Title: Beverly Hills Cop: Axel F :: Path /home/media/Movies/Beverly Hills Cop Axel Foley () {imdb-tt3083016}/Beverly Hills Cop Axel F (2024) [NF][WEBDL-1080p][EAC3 Atmos 5.1][x264].mkv :: IMDB: tt3083016 - TVDB: 
2024-07-06 06:41:11.221 Info TraktListCollectionsCreateCollectionsTask: ProviderId: Imdb - tt3083016
2024-07-06 06:41:11.221 Info TraktListCollectionsCreateCollectionsTask: ProviderId: Tmdb - 280180

 

Emby.TraktListCollections.dll

sh0rty
Posted (edited)
10 hours ago, bakes82 said:

@shorty1483 I added InternalId, I guess he wants you to verify in DB/rest/log that they all are the same or something before he says what he says what he thinks the issue is.

 

2024-07-06 06:41:11.221 Info TraktListCollectionsCreateCollectionsTask: Internal Id 1377559 :: Title: Beverly Hills Cop: Axel F :: Path /home/media/Movies/Beverly Hills Cop Axel Foley () {imdb-tt3083016}/Beverly Hills Cop Axel F (2024) [NF][WEBDL-1080p][EAC3 Atmos 5.1][x264].mkv :: IMDB: tt3083016 - TVDB: 
2024-07-06 06:41:11.221 Info TraktListCollectionsCreateCollectionsTask: ProviderId: Imdb - tt3083016
2024-07-06 06:41:11.221 Info TraktListCollectionsCreateCollectionsTask: ProviderId: Tmdb - 280180

 

Emby.TraktListCollections.dll 137 kB · 0 downloads

So attached is the log with the new DLL and again a snippet from the library.db (all movies have IMDB and TMDB ID) plus the api call for the example movie. 

The ID given out by the plugin ist 163528 for Pulp Fiction, but in library.db, API call and site url it's 165060. IT seems the plugin is requesting the IMDb and TMDB IDs from 163528 which is the folder where the actual movie file sits with the ID 165060 containing the ProviderIDs, like visible in the screenshot.  The wrong internal ID seems to happen with every movie. I checked a handful and the IDs are all wrong, since the plugin reqests the ProviderIDs from the folder instead of the movie file itself in database.

It seems that the needed actual db entries containing the ProviderIDs are all type "5", the folders are type "3". Perhaps this could be a starting point for the plugin? In comparison, I checked the library for TV shows, since the plugin works with that. There are the ProviderIDs also in the folder entries of the DB. So this seems to be the reason why it works.

@bakes82  @Luke

library.db:
image.png.d870410f088bc70b41482370e800b90c.png

API:

{
    "Items": [{
            "Name": "Pulp Fiction",
            "ServerId": "14d786b2660149e198d5304a00316237",
            "Id": "165060",
            "RunTimeTicks": 92658450000,
            "ProviderIds": {
                "Imdb": "tt0110912",
                "Tmdb": "680"
            },
            "IsFolder": false,
            "Type": "Movie",
            "ImageTags": {
                "Primary": "90c03b8e475f32f4bc1cdb4f2fcbef0e",
                "Art": "38c6436352b586b138967739d70c4250",
                "Banner": "2ca6a287147be58ac333ea9323de827a",
                "Disc": "742d89f3a00461d6ce56f373e0f5ae92",
                "Logo": "94dca5b0badbc17b5b495723fa1e0235",
                "Thumb": "067228106942452814abdcc4b7bd2fde"
            },
            "BackdropImageTags": ["5d8f37df9dd01d11a949a2171e0e262f", "f1799053df5acd5ab8ecfb0e21a14088", "4222c65f47201b9d1970e24f18710806", "e090b9dbc94956413e22cbb3817779bd", "8fc20567131f2eeb5cf03a0e169f14a4"],
            "MediaType": "Video",
            "EndDate": "2016-01-09T23:00:00.0000000Z"
        }
    ],
    "TotalRecordCount": 1
}

 

embyserver (6).txt

Edited by shorty1483
  • Thanks 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...