Jump to content

Audio dramas scuppered again


Recommended Posts

steamhead
Posted

I appreciate from other conversations on here that Audio Dramas are a bit niche, so I don't expect I will ever see a content type to support them directly, but I do wish when I find something that works you don't do things to break it, especially when the change doesn't seem to give benefit.

Originally I used Books, as the organisational aspect worked for Audio Dramas, but a while back you took away support for audio files, so that killed that content type.

So then I tried Audiobooks, which treats the content more like Albums, which just doesn't work due to multiple and varying cast members stopping the use of Artists to group series, and the absence of individual Artwork, and Overview text for episode synopsis.

So I switched  to "mixed content", which wasn't perfect, but it supported audio and was usable as the By Folder view allowed for grouping into genres, shows and series, and within each folder the content was sorted into track order, with individual artwork and synopsis.

Unfortunately it appears something has changed recently, as when I added a new series I have noted that now the contents is being listed in alphabetical order of the title, not track number like it used to.  I know I'm not misremembering as my older series are still showing in track order, it's only when I rescan a folder that it ignores the track sequence.  So all my old content works, but new and modified stuff is useless, you can't listen in sequence any more.

I did look at release date, but even though the date is fully set inside the mp3 tag, Emby is only honouring the year, so all episodes released in the same year are then sorted alphabetically.  Even then many episodes are often released on the same day.

Any chance we could have track sequencing back? I don't know when the change happened, but I've only added new content recently.

Posted

Hi, I would suggest the audio books content type. The drawbacks you mention are really just features that haven't been implemented yet.

steamhead
Posted

@cayars

If they're not implemented yet, then I can't use them unless I'm missing something?  The features are already there in Mixed Content, apart from losing the track sequence.

I kept the drawbacks short to avoid distracting too much from the simple fact that something that worked well, is now broken, but I can give more detail if it would help. 

Mixed content wasn't perfect, but much more ideal than Audio Books with the features it already had, which I can't see why it has gone away. Track number is after all a tag designed for sequencing and worked perfectly, failing that file name could also work.  The bulk of the code is clearly still there as all my old titles stay in track sequence, until you refresh the metadata. The ability to be able to choose the old behaviour at library level is all that would be needed.

With over 3000 audio drama titles I had to spend a lot of time reorganising my collection to make it work for Mixed Content after you took the audio feature away from books, and I'd happily do that again if audio books would improve matters, but at the moment it's a worse experience.

Is there an API out there that I could write my own type with, or extend existing one? You have already have content types that are almost there, such as Movies or TV, but they don't support audio episodes, which is a shame as many of my audio dramas are continuations of TV shows, and many older TV shows have missing episodes that only exist in audio form.

Alternatively is there a way to mass import data?  For example release date would work to sort them, but there are no meta data providers to set that for Audio Drama, and without that Emby appears to use the mp3 date tag, but only to the level of year, so a whole season ends up in alphabetical order.  If I could find ways to mass import release date that would sort it.  Otherwise I'm on a long slog to set them all by hand 😞

Posted

Hi,

If you know SQL you should be able to do a bulk import of the release date info if you have that info organized in some type of list that would match your database. You could likely do it in some form using the API as well.

Do you have the release date info already for these titles?

  • Thanks 1
steamhead
Posted

Hi Cayars,

Yes I know SQL, I just don't know how to get at Emby data with it.  I've not dug into anything of that ilk yet with Emby as apart from Audio Dramas I've managed to get stuff working from the UI directly.  Any pointers greatfully received, but knowing SQL is an option is a big help to give me other things to look for. - thanks.

I don't have all the release dates in a file as such yet, but I could certainly massage the data into one more quickly than I could edit each one into Emby via the UI or Metadata manager.  I'd certainly feel happier maintaining an external copy of release dates, so I can easily reload it if I ever need to rebuild the library.

Thing have moved on a bit since my first post, and I've been trying to get Audiobooks working with a chunk of my collection, and that is even more dependent on release dates, so an external import/rebuild will be even more key.

Thanks

Dean

Posted

Here is what I'd suggest you check out to see if this would be a help.

Install the Reports Plugin from the catalog.  This plugin will allow you to export to csv or excel which should give you a great start for tracking your dates and already have the keyfields needed later to do the updates against.

Let us know if you think this will be of help to get started with.

Carlo

steamhead
Posted

Hi Carlo,

I had looked at that before, unfortunately it doesn't distinguish between an Audio Book and a Song, and nothing in the filters helps either, so I get 21000 entries, of which only 3000 are audio books, the rest are my music collection.  At the time I didn't see much use for it, but now it will be a good base, if I filter it post export to get it down to just audio books.

I can see if I maintain my data in the export, use it for bulk update and then re-export beforehand if I need to rebuild the library then I could see this protecting the time put in to get data in shape.

I'll give that a go.

Cheers

Dean

steamhead
Posted

Well it was a nice thought, unfortunately it's not exporting release dates for any entries in an Audiobooks library type 😞

The export shows release dates for all my music, but the few Audiobooks that I have explicitly set a release date in the UI are showing blank in the export

Cheers

Dean

 

Posted

It was a nice thought. I had hopes using just the path field alone you would be able to identify what is part of the  Audiobooks library.

Can you not tell your music from Audiobooks by path?

steamhead
Posted

Fortunately, as my media collection starts life in MediaMonkey I'm able to set many tags at a stroke organisationally, and all my Audiobooks already had a genre of either Audiobook, or Audiobooks, depending on where they came from.  So it's easy enough to filter them post export, the problem is it's looking like the report isn't populating the "Release Date" field for any of my audio books, even ones I've explicity entered a date against using "Edit metadata".

Also you mentioned the path field, I'm not getting that, all I'm getting is Locked, ImagePrimary, ImageBackdrop, ImageLogo, Name, AlbumArtist, Album, Disc, Track, DateAdded, ReleaseDate, Year, Genres, ParentalRating, CommunityRating, Runtime, Audio

Posted

You can edit what fields get exported.  See if that info is there on Movies. Maybe it doesn't export in music but I'd think the Path is useful for all media types.

steamhead
Posted

tbh I'd already tried the fields feature, but found it didn't make any difference to the files I generated, only what was shown in the browser, for example I deselected "Date Added" but it still ended up in the output file. 

Yes you're correct Path would be useful in all media types, but it only appears in Movies and Episodes for some reason.

Though looking at the other types did make me realise I was entering Release Date at album level not song level, and when I do a report for Albums I DO get to see the release dates I entered, albeit without Path.

So I can use this as a good base to collate release dates into, then all I have to do is figure out how to import that back into Emby.

  • Like 1
Posted

Sounds like a plan. By finding the "Release Date" at the song level at least it wasn't a waste of time. :)

steamhead
Posted

Some mixed results overnight.

Looking at some of the Albums that didn't have Release Date set manually in Emby, I noticed that instead of sorting by Title, as I'd first thought, it's sorting by Year first, and then Title.  So any range with only one release a year is sorting correctly, but with more than one in a year it's down to the Title name.  The crazy thing is that when I check  these titles in Media Monkey, the DATE field is set to a fully qualified date, yet Emby is only using the Year part - smells like a bug to me, or at least something that could be massively improved upon with probably very little effort.

That aside, having realised I already have a lot of the real dates set within the date fields of the files, I thought about writing an export script from Media Monkey to update the file created by the report.  Until I realised that you could probably call the Emby REST API from a Media Monkey script directly, so in theory I could drive a lot of my manual changes to Emby from Media Monkey where the data already lives.

So I tried a proof of concept, and you CAN call Emby directly from Media Monkey (albeit slowly, Emby sorting by the whole date field would be much faster).  All I have to do now is figure out how to update a specific field (Release date) of a Specific Track (or Album) from the API, bearing in mind that in Media Monkey I know the Title, the Album, the Album Artist, the Artists and the Path that should match with what is in Emby for a lookup.

So I'm digging through the API docs to look for the right call, any hints greatfully received.

steamhead
Posted

Looking at the API docs on Swagger, it looks like Emby follows the traditional REST API approach of issuing a call to lookup the item to get an ID, and then a follow up request using that ID to update the item.  The problem is I can't find a call that will give me the ID of an Item.

I tried /Items/RemoteSearch/MusicAlbum (there wasn't one for Audiobooks - I'm beginning to spot a theme about the Audiobooks content type) and whilst it couldn't find any of my audio dramas, it did find some of my music albums. But then it also found some albums I hadn't got, so I suspect this call is to lookup data from data providers, not your own library.

Then I tried /Items which looked hopeful from the description.  I entered a known Artist and Album name both for a Music album and an Audiobook with no results yielded in either case.  I also issued the requests with no arguments and it gave me back a list of the folders being monitored as libraries, so I'm not really sure what that request is supposed to achieve.

I can't see any other likely candidates, I suspect I may also be suffering from the Audibooks curse of "features that haven't been implemented yet" as there's no mention of Audiobooks anywhere on Swagger that I can see (assuming they're not just treated as music).

So after some initial excitement I think I'm back to a lot of slog to get Audiobooks in a condition that is almost useable.

I'm using Audiobooks now for a portion of my library, after I've used it for a while I'll write up the issues here to see if any of them have alternative approaches or new features may be easy to implement.

Cheers

Dean

PenkethBoy
Posted (edited)

@steamhead

some hints to help you out with getting back "just" audiobook data while using the items endpoint in swagger

1. Audiobooks content type is a similar content type to Music - but with less features in the gui - but works the same in the api (mostly)

2. i think you missed out a couple of things when using the API - that catch new users out :)

2.1 always ensure you have "recursive" set to true - otherwise it only searches the top level of info so without that you usually get zero results or not what you expect. Its set to false as default. In some cases it does not apply but setting it does not break anything so always worth setting.

2.2 to focus the results on your Audiobooks library you need to add ParentID to the api url - you can find this easily by going to the home page of your Audiobooks library and look at the url in the browser as ParentID will be at the end of the url. If you have more than one Audiobook library then you can specify both or more.

2.3 If you want to return say all the albums from your audiobook library you also should specify IncludeItemTypes = MusicAlbum otherwise you will get Artists and other types returned etc - unless you want this info as well etc. I tend to go for just one itemType at a time to simplify processing the results.

for 2.1 to 2.3 these options are set in swagger to generate the correct url - for testing - which i think you have figured out already :)

2.4 So as an example for my audiobooks library if i want a list of all Albums - setting the above options gives me..

.../emby/Items?Recursive=true&ParentId=3aeb99515c5a4d67fe12f482a99e3d6c&IncludeItemTypes=MusicAlbum&api_key=<api_key>

2.5 Or if i wanted all the tracks(songs) i have in my Audiobook library

..../emby/Items?Recursive=true&ParentId=3aeb99515c5a4d67fe12f482a99e3d6c&IncludeItemTypes=Audio&api_key

2.6 setting other options in swagger will reduce/filter the returned data set as necessary and also allow you to sort the data etc etc

e.g searching for "Terry Pratchett" tracks - sorted ascending

.../emby/Items?Recursive=true&SortOrder=Ascending&ParentId=3aeb99515c5a4d67fe12f482a99e3d6c&IncludeItemTypes=Audio&Artists=Terry%20Pratchett&api_key=<api_key>

i could have used ArtistID as an alternative to Artists and added a Sortby parameter - DateCreated in this case

e.g.

.../emby/Items?Recursive=true&SortOrder=Ascending&ParentId=3aeb99515c5a4d67fe12f482a99e3d6c&IncludeItemTypes=Audio&SortBy=DateCreated&ArtistIds=21651&api_key=<api_key>

 

etc etc

Have fun

Edited by PenkethBoy
  • Thanks 1
steamhead
Posted

Fantastic, now I'm cooking with gas.  The parentID and the rescursive secret sauce seems to have done the job.  So now I just need to fine tune that from a VBScript in Media Monkey, work out an easy way to parse the response and then figure out how to turn that back on Emby as an update.

I may be gone some time...

Thanks so much

Cheers

Dean

PenkethBoy
Posted

@steamhead

couple of extra tips

unless you have to use VBScript in mediaMonkey or even use MM at all

might be better to use Powershell as it can handle JSON files with no problem and can connect "simply" to emby - full GET and POST operations etc etc

also when you come to change any metadata in Emby - you HAVE to pull the full record/data for an item and return that full record to Emby - you cant amend one property and return it to Emby.

if you get stuck open a thread in the API sub forum and we can get you sorted there

steamhead
Posted

Media Monkey is pretty much at the heart of my media managenent, I have a set of scripts that get my data just the way I like it, automatically standardising the tagging.  I don't find VBScript too tricky, it will give me some new functions to write and have fun with.

I've already got Media Monkey able to get an ID out of Emby, the only bit I've not figured out is how to get the whole record back

PenkethBoy
Posted

OK fine - go with what you are used to.

make sure its a properly formatted JSON file as the body, that you return and its content type is set correctly in the POST to ensure it supports any unicode characters - otherwise they will get mangled by Emby

steamhead
Posted

I'm not envisaging problems with the JSON file (famous last words), it should be easy enough to maniupulate the JSON retrieved for the whole record and put that back directly, my problem is getting the whole record.

I've got no problem finding the item ID of the record I want, but then things are a bit vague in the Wiki and Swagger as what to do next - "When retrieving a single item, the entire object is returned. When querying for items, the return data will be stripped to include only a minimal amount of information.".  No matter what I do with the Items query, even if I only get one result, I get the stripped down version, and the Wiki doesn't say how to retrieve a single item to get the full record.
 

I can't see anything on Swagger about getting items by Item ID, but looking at other services, with 199962 being a known Item ID, I tried -
http://nnn.nnn.nnn.nnn:8096/emby/Items/199962?&api_key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

And I get "Unable to find the specified file", I also tried /Item singular, and dropped the upper case first letter for both, but all returned the same.

I think once I figure out the ability to get the full record I should be able to write quite a lot of useful integration with Media Monkey to help automate a lot of media housekeeping.

btw, I think a Wiki page showing the workflow, with examples of finding an Item Id (with the tips about ParentID and Recursive), getting the whole record, and then putting the whole record back would be a really useful page - anybody know if such a beast exists. or how to get one written?

 

 

PenkethBoy
Posted

@steamhead

what i do is this, as i authenticate as an admin user first (so my api key is the user access token not an api key from the api section of the dashboard).

use ../emby/users/<user.id>/items/<item.id>?api_key=user.accesstoken

that returns the full item json

once amended

use ..emby/items/<item.id>?api_key=..... to POST it back - and make sure you set the content type as "application/json; charset=utf-8" so it supports unicode characters

  • Thanks 1
steamhead
Posted

That's intriguing, I didn't get my api_key from the API section of the dashboard, it's simply the api_key Swagger decided upon without my input. When I look in the APIs section there's nothing in there, so I wonder where it came from?

It's a shame the emby/Items endpoint doesn't work, I'd hoped to avoid the extra step of authenticating each time and all the complication that adds.  I wonder if it was supposed to work and is an oversight, as I can't think why I can query, and update without choosing a user, but have to choose one to read the whole record.

I'll give that a whirl with the users route and see how it goes, thanks again.

PenkethBoy
Posted

the swagger api_key is auto generated for swagger and lasts for a couple of days IIRC - and is only for testing

hence why auth by user or the api_key from dashboard are the recommended way to go - if you use the api_key method from dashboard you dont need to auth each time

your admin user.id is static so you can hard code that if you want

And yes you have to use the Used.id in the url or you get an error about "specified file"

 

PenkethBoy
Posted

ah i remember now

the error cant find specified file is returned when the endpoint you are trying to use does not exist

and .../emby/items/{itemid} is not a valid endpoint for a GET but is for POST

1347888106_Annotation2020-08-21174731.thumb.jpg.4486d836754ec1bd760092d2bc1ef2c7.jpg

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