Jump to content

Plugin - Chapter Editor (ChapterApi)


TeamB

Recommended Posts

rbjtech
35 minutes ago, crusher11 said:

Yes, I have that update as well, that's why I'm trying to find the problem episodes. However, the update seems to have broken the import functionality nearly completely, as I cannot import the intro/end credit points back into most those episodes.

ok - lets not derail this thread - but ping me and cheese on a PM as I've had no issues with the update.  Thanks.

Link to comment
Share on other sites

TeamB
2 hours ago, rbjtech said:

as a stand alone general chapter editor

yes that is all this plugin is intended for.

2 hours ago, rbjtech said:

a) Lock data in the chapter table in the emby dB

I think this is the only valid option.

2 hours ago, rbjtech said:

From the lessons learnt in the Introskip Plugin - the above saving of data is #1 on the list for a plugin like this - users spending lots of time curating chapters etc will, understandably, get rather peeved if they lose edits on a metadata refresh...

The data is stored in the Emby server library db, there is no need to keep extra copies or data sources for this.

 

Edited by TeamB
  • Like 1
Link to comment
Share on other sites

crusher11
1 hour ago, TeamB said:

I think this is the only valid option.

The data is stored in the Emby server library db, there is no need to keep extra copies or data sources for this.

If the media file is moved, you lose all your chapter data.

Link to comment
Share on other sites

rbjtech
7 minutes ago, crusher11 said:

If the media file is moved, you lose all your chapter data.

This is no different if you edited other metadata for that Item as well - the data needs to be 'managed' in the Emby dB.

If you opt to use NFO - then chapters are currently omitted - so I think as long as the Core Team make a decision to a) lock chapter data and b) hopefully save to NFO's as part of the normal NFO core integration - then I believe we are good.   If you then 'moved' an item - then the NFO would re-import the data (incl chapters) as part of the emby identification phase.

These things are not something which should be in any plugin - we have been down that road and learnt the lesson.. ;)

@Luke @ebr @Cheesegeezer @chef

  • Like 2
Link to comment
Share on other sites

crusher11
17 minutes ago, rbjtech said:

This is no different if you edited other metadata for that Item as well - the data needs to be 'managed' in the Emby dB.

@Luke @ebr @Cheesegeezer @chef

As you say, it can't be saved in an NFO, so it is different. I save all my meta data, images, subtitles and bif files with my media, so outside of chapters I can move anything at any time with zero issue. 

Link to comment
Share on other sites

TeamB
28 minutes ago, rbjtech said:

These things are not something which should be in any plugin

yes correct, the core needs to manage storage, how it is backed up, how you store the data and how you can migrate the data. This is all core functionality, trying to force this to a plugin is just asking for issues.

This plugin is just an viewer/editor of chapter data.

  • Like 1
  • Agree 3
Link to comment
Share on other sites

Cheesegeezer
9 hours ago, rbjtech said:

ok - lets not derail this thread - but ping me and cheese on a PM as I've had no issues with the update.  Thanks.

Agreed and i added you to continuing PM.

however the discussion has been useful for the plugin to relay it’s capabilities and where the responsibilities should lie for management 

Link to comment
Share on other sites

Good day,

Can it be any talk within open thread as here and really why the "PM" matters? We sure like to hear all talk in open thread.

My best

Link to comment
Share on other sites

Junglejim
On 18/07/2022 at 20:55, TeamB said:

yes correct, the core needs to manage storage, how it is backed up, how you store the data and how you can migrate the data. This is all core functionality, trying to force this to a plugin is just asking for issues.

This plugin is just an viewer/editor of chapter data.

I just had a idea about the permanent feature of chapter data. I understand that It's all stored in the db and there's no way around that at the moment.

Back in the day I used to utilize a site called chaptersdb. That's not available anymore but it's archived here as read only.. https://chapterdb.plex.tv/ (still useful for some of the older stuff).

What I was thinking was to have a option to export your changes to a chapter file that could be used with apps like MKVToolNix and integrate them directly into the source media.

Obviously it's probably beyond the scope of this project but I thought I'd throw it out there.

Edited by Junglejim
Link to comment
Share on other sites

TeamB
48 minutes ago, Junglejim said:

I just had a idea about the permanent feature of chapter data. I understand that It's all stored in the db and there's no way around that at the moment.

Back in the day I used to utilize a site called chaptersdb. That's not available anymore but it's archived here as read only.. https://chapterdb.plex.tv/ (still useful for some of the older stuff).

What I was thinking was to have a option to export your changes to a chapter file that could be used with apps like MKVToolNix and integrate them directly into the source media.

Obviously it's probably beyond the scope of this project but I thought I'd throw it out there.

I thought there were already tools out there that would adjust the chapters in your mkv files based on supplied chapter lists?

Link to comment
Share on other sites

Junglejim
3 minutes ago, TeamB said:

I thought there were already tools out there that would adjust the chapters in your mkv files based on supplied chapter lists?

Yep there sure is as I stated above! I was suggesting a export feature of a chapter file to use with said tools. Never mind, obviously too hard. All good.

Link to comment
Share on other sites

TeamB
7 minutes ago, Junglejim said:

Never mind, obviously too hard. All good.

Wtf is it with people getting all pissy these days.

If you are talking about extracting the chapter data for an emby item and then using that chapter data in a tool to write that back to an mkv file all i was saying that is already possible. The actual emby chapter data has been available from the already available item info rest api for a very long time. All you need to do is write a script to grab the data, format it, feed it into your fav mkv remuxer and you are done. This is possible to do now not using any emby plugin at all.

 

Link to comment
Share on other sites

Junglejim

LOL. Didn't mean to come off 'all pissy'. Take a chill pill mate! I said 'it's probably beyond the scope of this project'. I think you should read the posts more carefully before you go on a rant. Plus if it's so readily available how hard would it be to export that data to a file that people can import to apps like MKVToolNix?

It was just a out there suggestion, if you didn't like it just say so!

Link to comment
Share on other sites

TeamB
21 minutes ago, Junglejim said:

Plus if it's so readily available how hard would it be to export that data to a file that people can import to apps like MKVToolNix?

To extract the chapter data, probably 10 lines of python code.

Yes i agree, its not really in scope for this plugin.

 

Link to comment
Share on other sites

Cheesegeezer
1 hour ago, Junglejim said:

I just had a idea about the permanent feature of chapter data. I understand that It's all stored in the db and there's no way around that at the moment.

Back in the day I used to utilize a site called chaptersdb. That's not available anymore but it's archived here as read only.. https://chapterdb.plex.tv/ (still useful for some of the older stuff).

god !!! Lol 😂 I wrote a plugin in 2013 to use that api, until it went dead. Real shame.

 

1 hour ago, Junglejim said:

What I was thinking was to have a option to export your changes to a chapter file that could be used with apps like MKVToolNix and integrate them directly into the source media.

The MediaTool box plugin i made could probably handle this in conjunction with TeamB’s Editor.

edit chapters and then write them to the container. The beauty of a plugin… the user decides if they want that functionality or not.

Link to comment
Share on other sites

Junglejim
42 minutes ago, TeamB said:

To extract the chapter data, probably 10 lines of python code.

Yes i agree, its not really in scope for this plugin.

 

Thanks mate, that's all I needed to hear. 👍🍻

40 minutes ago, Cheesegeezer said:

god !!! Lol 😂 I wrote a plugin in 2013 to use that api, until it went dead. Real shame.

 

The MediaTool box plugin i made could probably handle this in conjunction with TeamB’s Editor.

edit chapters and then write them to the container. The beauty of a plugin… the user decides if they want that functionality or not.

@Cheesegeezer  Yep the good old days.. :) Definitely will take a look at this. Cheers 🍻

Is this it? Not to sure how this will go with Linux in a container environment but there has to be a solution..

 

Edited by Junglejim
  • Agree 1
Link to comment
Share on other sites

TeamB
9 hours ago, Junglejim said:

Thanks mate, that's all I needed to hear. 👍🍻

The following is not using any Emby server plugins, this is all just built into the server query endpoint and has been for years.

To extract ALL the chapter data from Emby for all Movies and Episodes you can use the following API endpoint query

http://localhost:8096/emby/Items/?IncludeItemTypes=Episode,Movie&Recursive=true&Fields=ProviderIds,Chapters,Paths&EnableImages=false&api_key=ad490d752a0145ab82d877c386391faf

Just drop the above link into your browser, you will need to change the api_key to one you generate on your server and perhaps use an actual IP address instead of localhost.

This will give you chapter info for movies and episodes you can then process in any language of your choice.

Example Python

import requests

api_key = "ad490d752a0145ab82d877c386391faf"
host = "localhost:8096"
url = "http://" + host + "/emby/Items/?IncludeItemTypes=Episode,Movie&Recursive=true&Fields=ProviderIds,Chapters,Path&EnableImages=false&api_key=" + api_key
emby_data = requests.get(url).json()

for item in emby_data.get("Items", []):
    chapters = item.get("Chapters", [])
    if len(chapters) > 0:
        providers = item.get("ProviderIds", {})
        providers_lst = []
        for provider in providers:
            providers_lst.append(provider + ":" +  providers.get(provider))
        print (item.get("Name") + " (" + item.get("Type") + ") (" + item.get("Id") + ") (" + "|".join(providers_lst) + ")")
        for chapter in chapters:
            print(str(chapter.get("ChapterIndex", 0)) + "|" + chapter.get("Name") + "|" + chapter.get("MarkerType") + "|" + str(chapter.get("StartPositionTicks", 0)))
        print()

The above just print out all your items that have chapters. You can create chapter files or call your tools or do anything you want with the data at this point.

 

Edited by TeamB
Link to comment
Share on other sites

TeamB

latest version in the first post now has a play button for the chapters so you can check the chapter start point against the video.

if there are no bug reports in the next few days I might put this up in the plugin catalogue.

 

  • Like 2
Link to comment
Share on other sites

rbjtech

Hi TeamB,

Great plugin - I find it really useful when looking into Introskip issues ;)

May I make a couple of suggestions ?

a) Can you add the episode number to the title of the episode - the same as what is listed on the left ?  This makes it easier without needing to cross reference to the list on the left.

image.thumb.png.f7238597c91fefbb069f034b95afca32.png

b) I know you can search (which is fantastic), but would it be possible to sort the items ignoring 'The' and 'A' etc in the titles ?    When looking for/scrolling items, this makes it a little more logical finding shows.

image.png.bd0c8ab7c10428d8604d11d9d3b1ccbb.png

c) - this one is on the 'wish list' - haha.

The Introskip plugin currently shows the IntroStart/End and CreditStart as thumbnails - which gives you are very quick way to confirm the Intro and Credits are 'good' without needing to playback each episode.  There wouldn't be much need to do this for 'chapters', but for the special marker types - I find this particularly useful as any episode 'out of the ordinary and not matching the others' can then be investigated.

image.thumb.png.b739331ab6e18d688eda177df3ad9751.png

 

Thanks for reading / consideration .. 

 

Link to comment
Share on other sites

TeamB
11 minutes ago, rbjtech said:

Can you add the episode number to the title of the episode - the same as what is listed on the left ?  This makes it easier without needing to cross reference to the list on the left.

this can be added

14 minutes ago, rbjtech said:

b) I know you can search (which is fantastic), but would it be possible to sort the items ignoring 'The' and 'A' etc in the titles ?    When looking for/scrolling items, this makes it a little more logical finding shows.

I can look into ordering by sort title, that might help.

21 minutes ago, rbjtech said:

The Introskip plugin currently shows the IntroStart/End and CreditStart as thumbnails - which gives you are very quick way to confirm the Intro and Credits are 'good' without needing to playback each episode.  There wouldn't be much need to do this for 'chapters', but for the special marker types - I find this particularly useful as any episode 'out of the ordinary and not matching the others' can then be investigated.

that is what the play action if for, it lets you check the start time for the chapter is correct.

Link to comment
Share on other sites

rbjtech
38 minutes ago, TeamB said:

this can be added

Great - thanks

38 minutes ago, TeamB said:

I can look into ordering by sort title, that might help.

ok - it's a minor point, but sorting by Sort Title could be useful - thanks.

38 minutes ago, TeamB said:

that is what the play action if for, it lets you check the start time for the chapter is correct.

Sure - the Plugin has the live playback as well, but it was rarely used as the thumbnail told the story without needing to look at every episode - a list of 'timings' means nothing for Intro's not starting at 0:00 - but a thumbnail that is almost frame perfect confirms things nicely.

Anyway - as I said, a nice to have - I can help contribute to the ffmpeg command to grab the thumbnail if you are interested as we did for the Introskip version or we may be able to grab the existing thumbnail extracts from emby if the exist.    If it's a step too far - then no issues :)

Thanks !

Edited by rbjtech
Link to comment
Share on other sites

rbjtech
1 hour ago, TeamB said:

new build in the first post with sort title and index number.

 

 

Fantastic - thanks for the updates !

image.png.9d732d75653ff8ac0bf4719bbf510dae.png

image.png.a1085b6a3a6b453e2ea3af91a7b3e349.png

  • Like 1
Link to comment
Share on other sites

Mookdog

All I can say is WOW. I just got a chance to check out the plugin. Kudos for all the hard work on this. I used it mainly to remove some intro skips that werent correct and it worked beautifully

 

Mook

  • Like 1
  • Agree 1
Link to comment
Share on other sites

chef

Wow! This plugin is wild! 😁

Did you guys ever figure out how to keep edited items during a  metadata refresh?

Would a db if edited items be to much?

To redundant?

 

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