Jump to content

Automatic version grouping for movies


MikePlanet

Recommended Posts

cyrus104

If I have a drive crash with the Emby database on it and I've already run this, how can I record the db to include the groupings?

For example I've run conversion on an entire library, Emby by default didn't group them so I used this plugin and almost everything is better.... Then a drive crash / db loss. I've reinstalled Emby and am back to many duplicates, would I just re run this plugin to have it fix the grouping?

Link to comment
Share on other sites

Happy2Play
44 minutes ago, cyrus104 said:

If I have a drive crash with the Emby database on it and I've already run this, how can I record the db to include the groupings?

For example I've run conversion on an entire library, Emby by default didn't group them so I used this plugin and almost everything is better.... Then a drive crash / db loss. I've reinstalled Emby and am back to many duplicates, would I just re run this plugin to have it fix the grouping?

The plugin groups by same external provider ids.  So all you should need I believe is a library scan.

Link to comment
Share on other sites

cyrus104
36 minutes ago, Happy2Play said:

The plugin groups by same external provider ids.  So all you should need I believe is a library scan.

That's good news, I'll give it a try. This started due to previously being on Plex and having a crash, not Plex fault. So I've made the switch to Emby. I would like to test running the conversion on all files from my high performance GPU machine then rescan on my NAS normal Emby server.

Link to comment
Share on other sites

On 11/9/2020 at 9:31 PM, bakes82 said:

Can this also be modified to run on "Channels"?

Hi bakes82.  What do you mean by this?

Link to comment
Share on other sites

MikePlanet
On 10/23/2020 at 11:44 AM, Happy2Play said:

Didn't even know there was settings on the plugin.  But I get the same results, no errors in log but a console error.


router.js?v=4.5.2.0:1 appRouter - processing path request /web#!/configurationpage
router.js?v=4.5.2.0:1 appRouter - user is authenticated
VM173:45 Uncaught (in promise) TypeError: $(...).checked is not a function
    at <anonymous>:45:59
(anonymous) @ VM173:45
Promise.then (async)
(anonymous) @ VM173:44
dispatch @ jquery.slim.min.js?v=4.5.2.0:2
v.handle @ jquery.slim.min.js?v=4.5.2.0:2
onViewChange @ viewmanager.js?v=4.5.2.0:1
(anonymous) @ viewmanager.js?v=4.5.2.0:1
Promise.then (async)
ViewManager.loadView @ viewmanager.js?v=4.5.2.0:1
(anonymous) @ router.js?v=4.5.2.0:1
(anonymous) @ router.js?v=4.5.2.0:1
Promise.then (async)
loadContentUrl @ router.js?v=4.5.2.0:1
(anonymous) @ router.js?v=4.5.2.0:1
onInitComplete @ router.js?v=4.5.2.0:1
(anonymous) @ router.js?v=4.5.2.0:1
(anonymous) @ router.js?v=4.5.2.0:1
(anonymous) @ router.js?v=4.5.2.0:1
Promise.then (async)
(anonymous) @ router.js?v=4.5.2.0:1
handleRoute @ router.js?v=4.5.2.0:1
page.dispatch @ page.js?v=4.5.2.0:1
page.show @ page.js?v=4.5.2.0:1
(anonymous) @ router.js?v=4.5.2.0:1
show @ router.js?v=4.5.2.0:1
showItem @ router.js?v=4.5.2.0:1
executeAction @ shortcuts.js?v=4.5.2.0:1
onClick @ shortcuts.js?v=4.5.2.0:1
onClick @ emby-itemscontainer.js?v=4.5.2.0:1

 

yep, I can confirm this settings istn't working (anymore!?).

tbh - I added this in the very beginning when I wasn't sure if the grouping works fine and it might be preferrable to be able to prevent certain movies from being grouped together - but I never used the option myself, as the plugin does what I want in the background without worrying about it 😉

So ... I would suggest removing the setting to get rid of the issue - unless there are really good arguments why it is needed !?

Link to comment
Share on other sites

bakes82

@cayars

Im making plugins that make channels from trakt lists, and it adds multiple versions.  It looks like it merged them though, I know Enola Holmes has 1080p/4k and I see now its combined, so I guess I just need to wait for the merge process to run.

 

image.thumb.png.2d342d28b8dce4f73b9538928f5a6c77.png

Link to comment
Share on other sites

If you open the detail page for Enola Holmes and look at the bottom do you see both versions listed?  Do you get a drop down list box to choose versions?

BTW, have you looked at the SmartPlaylist plugin which is wicked cool?  I ask because you can likely remove the need for trakt and automate this right in Emby itself.

Link to comment
Share on other sites

2 hours ago, bakes82 said:

Im making plugins that make channels from trakt lists

Are you planning on sharing it?
I can imagine a lot people over here would be thankful for it.

Link to comment
Share on other sites

bakes82

@cayars Its fixed, I just didnt wait long enough for the job to run, its correct.  After my channel/task runs it shows duplciates until this jobs tasks runs and merges them, so its minor.    Smart Playlist doesnt work for custom lists,  How do you tell it to make the top 250 imdb movies :P   Or the 2019 Oscar Nominated movies.  Did I miss that feature in it :P, I also dont like playlists.  The netflix list was just a reference because my local box has a smaller subset to work with and well I know I have netflix movies that matched on the netflix list I picked.

@neik Im not sure if Ill make it public or not.  I might and just not give support on it.  I understand its highly requested, you'd think the devs would add it themselves ;), seeing I took most of the code from the trakt plugin they built.  Its not super magical or anything, its just parsing a list compare with whats in emby.

Link to comment
Share on other sites

bakes82

@cayars You make no sense.  So your solution is for me to manually add tags to thousands of things and then use smart plugin?   How is that fast or automated, what happens when a new movie is added or one removed from the lists.  Thats the point of the trakt lists, you update 1 spot and then the plugin does the rest.  You can do you though. If you want to manually add tags and use smart plugins feel free.  Plex has many python scripts that will create library/collections/plugins from a imdb list or trakt lists and you can just cron it.  Otherwise Ill just write my plugin for me and save me lots of time.

Edited by bakes82
Link to comment
Share on other sites

I was simply throwing out another way this could be done and certainly wasn't saying it's a better way!
I myself like using Emby Tags and having all my lookup info local as I can do all kinds of cool things with it this way.

 

Link to comment
Share on other sites

bakes82

Right so you could write a plugin to add tags if you wanted I suppose :P  But you cant make a channel.  I also feel like its way more work to do it that way.

Link to comment
Share on other sites

That's true it wouldn't be a channel and could be more work.  If you're able to make use of playlists already created by someone else you're gold and this sounds perfect.
If you ever want to do things like automatically create playlists for specific actors, directors or things we have meta data already in Emby, Smartlist Plugin is ideal for this.

It would be cool to have both methods available.  Do you plan on releasing your plugin in the future or is it built for personal use?

I do however have a soft spot for TAGS and even more so with the BETA Server as the new search can find tags.  So all my "Submarine", "FighterJet", etc movies are easily found that I've tagged.

Link to comment
Share on other sites

  • 3 weeks later...
bakes82

Are there any logs for this?  I keep getting duplicate entries.  And the duplicates link to sources that dont exist.  But when I looked (Made new library only see 2 1917 options, then let it keep matching/scanning, after scan completed, came to look back and it merged them, but it has the dupes.)
image.png.693263acfefe4b60e7bac8f61aca068c.png

Link to comment
Share on other sites

43 minutes ago, bakes82 said:

Are there any logs for this?  I keep getting duplicate entries.  And the duplicates link to sources that dont exist.  But when I looked (Made new library only see 2 1917 options, then let it keep matching/scanning, after scan completed, came to look back and it merged them, but it has the dupes.)
image.png.693263acfefe4b60e7bac8f61aca068c.png

By any chance are you using the built in Emby grouping and the automatic grouping plugin?  If so there is likely a bug in the plugin duplicating what Emby has already grouped.

Link to comment
Share on other sites

bakes82
2 minutes ago, cayars said:

By any chance are you using the built in Emby grouping and the automatic grouping plugin?  If so there is likely a bug in the plugin duplicating what Emby has already grouped.

You would need to be specific where this magic toggle might be at.  I made a new library added the path.  So it whatever the stock settings are.

Link to comment
Share on other sites

bakes82
4 minutes ago, PenkethBoy said:

go look in your plugins list to see if its loaded

Im confused?  Is it built in now?

image.thumb.png.aad2b22c7a1797eb4ab93f6dd9891071.png

Edited by bakes82
Link to comment
Share on other sites

Yes you have the plugin and it's not part of the catalog but something you manually installed.

If I were to wager, I'd say your issue is caused by that 3rd party plugin doubling up with Emby created for you.

Link to comment
Share on other sites

bakes82

Oh because I added the file to the same folder for testing its breaking it, thats not my normal setup anyways, you dont keep the same files in the same folders with the arrs anyways.  Ill just move it out to a 4k path and then run it.  I was testing my kill script and because the referenced source doesnt exist I was getting null ref errors.

  • Like 1
Link to comment
Share on other sites

bakes82

@MikePlanet Can we please get the source code for this?  The bug for me isnt with the default grouping, its the fact that I have other "channels" like Imdb top 200 movies, if any of the movies appear in any other channels it tries to merge that channels version also, even though the channel is using the source from the main library.

My guess is you just need to do something like this: (IsVirtualItem = false)  But the plugin UI should also contain a checkbox list of the librarys it should merge items.  (I cant remember if the IsVirutalItem is a cure all since I also do another check in my code to see if the item I'm going to add to a channel is coming from one of the other channels and if so, ignore it, I also was getting many duplicates in my channels).  My assumption is it should only be merging items where they have the same parentId, but w/out seeing the code Im not sure what youre doing so I cant issue a PR to fix.
 

var mediaItems =
                    libraryManager.GetItemList(
                            new InternalItemsQuery
                            {
                                IncludeItemTypes = new[] {nameof(Movie)},
                                IsVirtualItem = false,
                                OrderBy = new[]
                                {
                                    new ValueTuple<string, SortOrder>(ItemSortBy.SeriesSortName, SortOrder.Ascending),
                                    new ValueTuple<string, SortOrder>(ItemSortBy.SortName, SortOrder.Ascending)
                                }
                            })
                        .ToList();

 

Link to comment
Share on other sites

MikePlanet
On 11/30/2020 at 8:28 PM, bakes82 said:

@MikePlanet Can we please get the source code for this?  The bug for me isnt with the default grouping, its the fact that I have other "channels" like Imdb top 200 movies, if any of the movies appear in any other channels it tries to merge that channels version also, even though the channel is using the source from the main library.

If you create items that are type filesystem, have a valid path, the plugin will include (and possibly merge) them - basically you're creating "duplicate" entries each pointing to the same media file!?

My guess is you just need to do something like this: (IsVirtualItem = false) 

@Luke: Can you confirm, that using filter "virtualitem=false" is the right approach? That would be easy to add/change.

But the plugin UI should also contain a checkbox list of the librarys it should merge items.

I don't think this is needed, as only Type "movie" with "physical" file is inspected anyway. Either ppl want to merge their versions or they don't want to.

Anyway, attached file added "IsVirtualItem=false" - so if your assumption is right that this excludes "Channelitems" it might work

AutoCollections.dll

Link to comment
Share on other sites

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