Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Podcast Series Order #600

Closed
AshbyGeek opened this issue May 12, 2023 · 32 comments
Closed

Podcast Series Order #600

AshbyGeek opened this issue May 12, 2023 · 32 comments
Labels
enhancement New feature or request

Comments

@AshbyGeek
Copy link

AshbyGeek commented May 12, 2023

Is your feature request related to a problem? Please describe.
Podcasts play from newest to oldest in the audible app, I want to play it the other way around so I thought I would download the episodes I haven't listened to yet (I've previously downloaded some of the podcast for archival purposes). Unfortunately, the 'series order' numbers are not reliable in this scenario. The oldest episode is currently labeled as episode 90 and the newest is episode 1. Since I'm using the series number in the name to differentiate, this means my books folder has multiple 'episode 1s' listed, since I downloaded them on different dates.

Describe the solution you'd like
Reverse the series order number of podcasts so that they will remain consistent as new episodes are published.

Describe alternatives you've considered

  • Provide a mechanism to rename existing files in libation's downloads folder to match updated tag information and custom file naming settings like in issue How to recreate folder structure? #426. This is a lesser solution because user intervention is needed to straighten out the mess.
  • Replace Audible's series order date with one derived from publication date. If it is possible to publish podcast episodes out of order (for example an episode is edited and audible insists on saving the new publication date) then this method will not be reliable.
  • For my podcast, publication date is very reliable and I could just drop the series number from my naming conventions. Unfortunately, without an implementation of issue How to recreate folder structure? #426 I would have to delete all 90 episodes of the podcast and re-download. I have a good internet connection so redownloading 5.38 GB wouldn't be all that painful, but it is definitely galling.
  • Complain loud and long to audible that they aren't doing their podcasts right. lol.

Additional context
I only have one podcast in the audible app, so it's possible that this is a problem unique to this podcast. If so, the podcast is Harry Potter and the Methods of Rationality and my proposed solutions will probably be inadequate.

@AshbyGeek AshbyGeek added the enhancement New feature or request label May 12, 2023
@Mbucari
Copy link
Collaborator

Mbucari commented May 16, 2023

@AshbyGeek Thanks for the detailed issue and your suggestions!

First of all, this problem is caused by Audible (or the podcast author/publisher). They've chosen to make the most recent episode #1, and then increment backwards. I doubt it's unique to this podcast, but it's not universal.

Replace Audible's series order date with one derived from publication date.

That's an interesting idea. At least moving forward, series numbers may be more accurate. The only problem I see is that the publication date may be missing for some queried items. If that happens, then what?

@rmcrackan What do you think?

#426

I really would like to make that feature, but it's fraught. If you begin remaining and suddenly one of the files has the same path/name as another file, what do you do? Give it a temp name until you that other file is renamed, the go back and rename it? That can get very hard to juggle correctly.

Maybe create a temporary books folder and move/rename all files into it, then move all files back to the main books folder? Maybe, but then you're running into potential problems like:

  • If the temp books directory is a sub directory of the primary, then file path lengths may be too long
  • If the temp books directory is a sibling of primary, they it may not even be on the same physical machine if the user is using symbolic links.

And then we have the problem of file locks. This is only a problem on Windows, but services like the search indexer and cloud folder sync may lock some files and prevent renaming/moving. Then what? Just leave the mess for the user to clean up?

Complain loud and long to audible that they aren't doing their podcasts right.

Deaf ears, my friend.


So I'm sorry to say, I think re-downloading is going to be your only option here.

@Mbucari Mbucari closed this as completed May 16, 2023
@Mbucari Mbucari reopened this May 16, 2023
@rmcrackan
Copy link
Owner

@Mbucari

That's an interesting idea. At least moving forward, series numbers may be more accurate. The only problem I see is that the publication date may be missing for some queried items. If that happens, then what?

Audible is a terrible steward of metadata, especially for less popular titles. Fixing their failings is sisyphean -- there's always one more (and Libation has many years of such fixes to prove it). This firmly falls into the category of: if you find it an interesting challenge to solve then go for it but it's not our job to fix.

A generalized solution would be for column ascending/descending sorting to apply within the podcast. That way the user can sort by release date ascending/descending and see whichever way they want. If no release date is given by audible, I imagine the default comparer will just clump them as DateTime.MinValue.

RE #426 -- I love this in theory. In practice, it's filled with all the problems you mention and so many more. Bulk file management is a logistical minefield.

@CharlieRussel
Copy link

CharlieRussel commented May 16, 2023 via email

@AshbyGeek
Copy link
Author

I haven't looked too hard into Libation's code, how hard would it be to add a per-podcast option to reverse the episode order? That way we could dump the inconsistent metadata problem on the end-user.

Alternatively we could add both a 'reversed series #' tag to those available in the custom file naming settings, and a per-series custom file naming overide. Again, haven't looked at the code yet so I don't have any idea how hard such changes are; I'm just trying to think of alternative solutions.

@AshbyGeek
Copy link
Author

I'll post some more replies on #426 for your comments that are more related to that issue.

@AshbyGeek
Copy link
Author

Also, I've asked the creator of this particular podcast if there's a way for him to correct the episode ordering issue using his publish tools.

@Mbucari
Copy link
Collaborator

Mbucari commented May 16, 2023

how hard would it be to add a per-podcast option to reverse the episode order?

Not sure yet. Are we talking about an operation performed at the time a file is written, not when the podcasts are imported in the library? So no DB modifications and the main display still shows the original titles?

@rmcrackan I'd been thinking about plugins, and I know you'd mentioned them before too. I could never get passed the questions of what scope to provide the plugin environment, but file naming/writing might be a really good place to start. Let plugins override things like filenames and write events.

@Mbucari
Copy link
Collaborator

Mbucari commented May 19, 2023

@AshbyGeek Version 10.3.0 is live. After you next scan your library you'll see that episodes are numbered chronologically.

@Mbucari Mbucari closed this as completed May 19, 2023
@rmcrackan
Copy link
Owner

After you next scan your library you'll see that episodes are numbered chronologically.

Does is still do a full scan if there are no changes to Books?

@rmcrackan
Copy link
Owner

Maybe Hangover needs a re-index button for times like this

@Mbucari
Copy link
Collaborator

Mbucari commented May 19, 2023

Does is still do a full scan if there are no changes to Books?

Yes. The full lubrary is re-imported after every full library scan, and the display grid is updated.

@rmcrackan
Copy link
Owner

But the search engine isn't re-indexed unless the database saves changes:

if (qtyChanges > 0)
await Task.Run(() => finalizeLibrarySizeChange());

LibraryCommands.LibrarySizeChanged += (_, __) => SearchEngineCommands.FullReIndex();

@Mbucari
Copy link
Collaborator

Mbucari commented May 19, 2023

But the search engine isn't re-indexed unless the database saves changes:

You're right, search won't re-index unless there's a new library book added. But the db is updated, so the grid display and file naming will reflect the new series numbering.

@Mbucari
Copy link
Collaborator

Mbucari commented May 19, 2023

@rmcrackan This is a bit out of scope for this issue, but since we're already here..
Maybe we should add a diff function to the importer and re-index if the library changed.

@Mbucari
Copy link
Collaborator

Mbucari commented May 19, 2023

@rmcrackan Nevermind, all is ok!

int qtyChanges = SaveContext(context);
logTime("importIntoDbAsync -- post SaveChanges");
// this is any changes at all to the database, not just new books
if (qtyChanges > 0)
await Task.Run(() => finalizeLibrarySizeChange());

qtyChanges tracks all changes, not just new books

@AshbyGeek
Copy link
Author

@AshbyGeek Version 10.3.0 is live. After you next scan your library you'll see that episodes are numbered chronologically.

Thanks! Worked like a charm. :)

@CLHatch
Copy link
Contributor

CLHatch commented Aug 7, 2023

I just downloaded a few podcasts (the sort that are more like a series of audiobooks), and the numbering was all over the place. One of them, they were all reversed (there are 8 episodes, episode 8 was listed as 1 in the metadata, and episode 1 was listed as 8), and another, it appeared to be random. HOWEVER, looking at the .metadata.json file, I found they also include a sort item. I'm guessing they don't even use the episode item themselves, and instead use the sort item. Perhaps Libation should "fix" the metadata using that?

Here's an example of "Episode 1" of "Alien: Out of the Shadows":

{
  "asin": "B08GCBT584",
  "asset_details": [],
  "authors": [
    {
      "asin": "B001IU0D3U",
      "name": "Tim Lebbon"
    },
    {
      "asin": "B07RJ1RB8T",
      "name": "Dirk Maggs"
    }
  ],
  "available_codecs": [
    {
      "enhanced_codec": "format4",
      "format": "Format4",
      "is_kindle_enhanced": false,
      "name": "format4"
    },
    {
      "enhanced_codec": "LC_128_44100_stereo",
      "format": "Enhanced",
      "is_kindle_enhanced": true,
      "name": "aax_44_128"
    },
    {
      "enhanced_codec": "LC_64_44100_stereo",
      "format": "Enhanced",
      "is_kindle_enhanced": true,
      "name": "aax_44_64"
    },
    {
      "enhanced_codec": "mp444128",
      "format": "Enhanced",
      "is_kindle_enhanced": true,
      "name": "mp4_44_128"
    },
    {
      "enhanced_codec": "mp44464",
      "format": "Enhanced",
      "is_kindle_enhanced": true,
      "name": "mp4_44_64"
    },
    {
      "enhanced_codec": "aax",
      "format": "Enhanced",
      "is_kindle_enhanced": false,
      "name": "aax"
    }
  ],
  "category_ladders": [
    {
      "ladder": [
        {
          "id": "18580606011",
          "name": "Science Fiction & Fantasy"
        },
        {
          "id": "18580607011",
          "name": "Fantasy"
        },
        {
          "id": "18580614011",
          "name": "Dramatizations"
        }
      ],
      "root": "Genres"
    },
    {
      "ladder": [
        {
          "id": "18580606011",
          "name": "Science Fiction & Fantasy"
        },
        {
          "id": "18580628011",
          "name": "Science Fiction"
        },
        {
          "id": "18580634011",
          "name": "Dramatizations"
        }
      ],
      "root": "Genres"
    },
    {
      "ladder": [
        {
          "id": "18580606011",
          "name": "Science Fiction & Fantasy"
        },
        {
          "id": "18580628011",
          "name": "Science Fiction"
        },
        {
          "id": "18580636011",
          "name": "First Contact"
        }
      ],
      "root": "Genres"
    }
  ],
  "content_delivery_type": "PodcastEpisode",
  "content_type": "Podcast",
  "customer_reviews": [
    {
      "asin": "B08GCBT584",
      "author_id": "amzn1.account.AG4X62VGE4ESSOOUYM3ILPN5CJIQ",
      "body": "good one.Had a very different experience on listening to the audiobook.overall i enjoyed the audiobook",
      "format": "Freeform",
      "id": "358bafa79d3443969803baf4bebe2c9c",
      "ratings": {
        "overall_rating": 4,
        "performance_rating": 3,
        "story_rating": 2
      },
      "review_content_scores": {
        "content_quality": 50,
        "num_helpful_votes": 0,
        "num_unhelpful_votes": 0
      },
      "submission_date": "2023-01-12T07:33:25Z",
      "title": "Good"
    },
    {
      "asin": "B08GCBT584",
      "author_id": "amzn1.account.AGEXCW6CONJKRGKQJUXPILMNOECQ",
      "author_name": "Jesse",
      "body": "This is just so good. I cannot even see how good this is. If you like the alien movie, he will like this.  ",
      "format": "Freeform",
      "id": "d13a1fd9f6404c2f83143ba9e579828c",
      "location": "",
      "ratings": {
        "overall_rating": 5,
        "performance_rating": 5,
        "story_rating": 5
      },
      "review_content_scores": {
        "content_quality": 50,
        "num_helpful_votes": 0,
        "num_unhelpful_votes": 0
      },
      "submission_date": "2023-01-04T17:44:02Z",
      "title": "Wow"
    },
    {
      "asin": "B08GCBT584",
      "author_id": "amzn1.account.AEKL6AT7DOOSZNADZU7MEYR24W2A",
      "body": "good one.Had a very different experience on listening to the audiobook.overall i enjoyed the audiobook",
      "format": "Freeform",
      "id": "ca21496f99f54017b9f85f5de37808c4",
      "ratings": {
        "overall_rating": 4,
        "performance_rating": 4,
        "story_rating": 4
      },
      "review_content_scores": {
        "content_quality": 50,
        "num_helpful_votes": 0,
        "num_unhelpful_votes": 0
      },
      "submission_date": "2022-09-29T08:34:43Z",
      "title": "good"
    }
  ],
  "episode_number": 6,
  "episode_type": "full",
  "format_type": "original_recording",
  "has_children": false,
  "is_adult_product": false,
  "is_listenable": true,
  "is_purchasability_suppressed": true,
  "is_vvab": false,
  "issue_date": "2018-12-07",
  "language": "english",
  "merchandising_summary": "<p>Unconscious, unaware, Ripley is the last human survivor of the Nostromo, her shuttle lost in deep space....</p>",
  "narrators": [
    {
      "asin": "B0C9MBM8ZJ",
      "name": "Rutger Hauer"
    },
    {
      "name": "Corey Johnson"
    },
    {
      "name": "Matthew Lewis"
    },
    {
      "asin": "B0C9M9XN4S",
      "name": "Kathryn Drysdale"
    },
    {
      "name": "Andrea Deck"
    },
    {
      "name": "Mac McDonald"
    }
  ],
  "plans": [
    {
      "end_date": "2099-12-31T00:00:00Z",
      "plan_name": "US Minerva",
      "start_date": "2020-08-20T19:13:00.00013Z"
    }
  ],
  "price": {},
  "product_images": {
    "500": "https://m.media-amazon.com/images/I/51qUUcL9noL._SL500_.jpg"
  },
  "program_participation": "Audible Original",
  "publication_datetime": "2018-12-07T00:00:00Z",
  "publisher_name": "Audible Originals",
  "publisher_summary": "<p>Unconscious, unaware, Ripley is the last human survivor of the Nostromo, her shuttle lost in deep space. Meanwhile, the crew aboard the mining ship Marion, faces a catastrophic collision with one of its own dropships and has to contend with the alien infestation on board.</p> <p>Marooned in a decaying orbit above the planetoid LV-178, the crew struggle to tackle the threat at hand, when an unexpected visitor makes her presence known.</p>",
  "rating": {
    "num_reviews": 10,
    "overall_distribution": {
      "average_rating": 4.741573033707865,
      "display_average_rating": "4.7",
      "display_stars": 4.5,
      "num_five_star_ratings": 72,
      "num_four_star_ratings": 12,
      "num_one_star_ratings": 0,
      "num_ratings": 89,
      "num_three_star_ratings": 4,
      "num_two_star_ratings": 1
    },
    "performance_distribution": {
      "average_rating": 4.802469135802469,
      "display_average_rating": "4.8",
      "display_stars": 5.0,
      "num_five_star_ratings": 69,
      "num_four_star_ratings": 8,
      "num_one_star_ratings": 0,
      "num_ratings": 81,
      "num_three_star_ratings": 4,
      "num_two_star_ratings": 0
    },
    "story_distribution": {
      "average_rating": 4.654320987654321,
      "display_average_rating": "4.7",
      "display_stars": 4.5,
      "num_five_star_ratings": 61,
      "num_four_star_ratings": 13,
      "num_one_star_ratings": 0,
      "num_ratings": 81,
      "num_three_star_ratings": 6,
      "num_two_star_ratings": 1
    }
  },
  "relationships": [
    {
      "asin": "B08GC2361R",
      "content_delivery_type": "PodcastParent",
      "relationship_to_product": "parent",
      "relationship_type": "episode",
      "sku": "PD_30EO_000001",
      "sku_lite": "PD_30EO_000001",
      "sort": "1",
      "title": "Alien: Out of the Shadows",
      "url": "/pd/Alien-Out-of-the-Shadows-Podcast/B08GC2361R"
    },
    {
      "asin": "B08GC1JF2B",
      "content_delivery_type": "PodcastSeason",
      "relationship_to_product": "parent",
      "relationship_type": "episode",
      "sku": "PS_30EO_000001",
      "sku_lite": "PS_30EO_000001",
      "sort": "1",
      "title": "season",
      "url": "/pd/season-Podcast/B08GC1JF2B"
    }
  ],
  "release_date": "2018-12-07",
  "runtime_length_min": 29,
  "sample_url": "https://samples.audible.com/pc/30eo/000001/pc_30eo_000001_sample.mp3",
  "sku": "PC_30EO_000001",
  "sku_lite": "PC_30EO_000001",
  "social_media_images": {
    "facebook": "https://m.media-amazon.com/images/I/51qUUcL9noL._SL10_UR1600,800_CR200,50,1200,630_CLa%7C1200,630%7C51qUUcL9noL.jpg%7C0,0,1200,630+107,79,402,402_PJAdblSocialShare-Gradientoverlay-smallasin-0to70,TopLeft,0,0_PJAdblSocialShare-AudibleLogo-Large,TopLeft,576,270_OU01_ZBLISTENING%20ON,593,216,52,500,AudibleSansMd,30,255,255,255_PJAdblSocialShare-PodcastIcon-Small,TopLeft,1094,50_ZBEpisode%201,106,519,48,404,AudibleSansMd,24,255,255,255.jpg",
    "twitter": "https://m.media-amazon.com/images/I/51qUUcL9noL._SL10_UR1600,800_CR200,50,1024,512_CLa%7C1024,512%7C51qUUcL9noL.jpg%7C0,0,1024,512+97,64,320,320_PJAdblSocialShare-Gradientoverlay-twitter-smallasin-0to60,TopLeft,0,0_PJAdblSocialShare-AudibleLogo-Medium,TopLeft,490,223_OU01_ZBLISTENING%20ON,483,152,55,450,AudibleSansMd,32,255,255,255_PJAdblSocialShare-PodcastIcon-Small,TopLeft,929,45_ZBEpisode%201,96,417,54,320,AudibleSansMd,24,255,255,255.jpg"
  },
  "thesaurus_subject_keywords": [
    "audible_original",
    "dramatizations"
  ],
  "title": "Episode 1",
  "ChapterInfo": {
    "brandIntroDurationMs": 0,
    "brandOutroDurationMs": 0,
    "chapters": [
      {
        "chapters": null,
        "length_ms": 1748323,
        "start_offset_ms": 0,
        "start_offset_sec": 0,
        "title": "Chapter 1"
      }
    ],
    "is_accurate": true,
    "runtime_length_ms": 1748323,
    "runtime_length_sec": 1748
  },
  "ContentReference": {
    "acr": "CR!8E9JHSKFWX2ZV3X0XBGGQSPDTSAK",
    "asin": "B08GCBT584",
    "codec": "mp4a.40.2",
    "content_format": "AAX_44_128",
    "content_size_in_bytes": 28200123,
    "file_version": "1",
    "marketplace": "AF2M0KC94RCEA",
    "sku": "PC_30EO_000001",
    "tempo": "1.0",
    "version": "17793621"
  }
}

If you look, it has "episode_number": 6,, which of course makes no sense. But then further down we see this:

  "relationships": [
    {
      "asin": "B08GC2361R",
      "content_delivery_type": "PodcastParent",
      "relationship_to_product": "parent",
      "relationship_type": "episode",
      "sku": "PD_30EO_000001",
      "sku_lite": "PD_30EO_000001",
      "sort": "1",
      "title": "Alien: Out of the Shadows",
      "url": "/pd/Alien-Out-of-the-Shadows-Podcast/B08GC2361R"
    },
    {
      "asin": "B08GC1JF2B",
      "content_delivery_type": "PodcastSeason",
      "relationship_to_product": "parent",
      "relationship_type": "episode",
      "sku": "PS_30EO_000001",
      "sku_lite": "PS_30EO_000001",
      "sort": "1",
      "title": "season",
      "url": "/pd/season-Podcast/B08GC1JF2B"
    }

I don't know if we should be looking at "sort": "1", in the PodcastSeason or the PodcastParent section, but they both have the correct episode number listed.

Edit:
Just to verify that it does appear to translate to the other episodes, here's from "Episode 7":

  "relationships": [
    {
      "asin": "B08GC2361R",
      "content_delivery_type": "PodcastParent",
      "relationship_to_product": "parent",
      "relationship_type": "episode",
      "sku": "PD_30EO_000001",
      "sku_lite": "PD_30EO_000001",
      "sort": "7",
      "title": "Alien: Out of the Shadows",
      "url": "/pd/Alien-Out-of-the-Shadows-Podcast/B08GC2361R"
    },
    {
      "asin": "B08GC1JF2B",
      "content_delivery_type": "PodcastSeason",
      "relationship_to_product": "parent",
      "relationship_type": "episode",
      "sku": "PS_30EO_000001",
      "sku_lite": "PS_30EO_000001",
      "sort": "7",
      "title": "season",
      "url": "/pd/season-Podcast/B08GC1JF2B"
    }

There was another series that I thought it was off by one, but that was because the one with sort equal to 1 was a "Teaser". So then the episodes "appeared" to be off by one, since the "Teaser" is actually the first "Episode".

@CLHatch
Copy link
Contributor

CLHatch commented Aug 7, 2023

Well darn, it appears this all depends on who authors the series? The "Harry Potter" podcast in the OP example appears to be using the episode_number "correctly", and sort value is all over the place?

@AshbyGeek
Copy link
Author

AshbyGeek commented Aug 7, 2023

Yeah, it might have been on another thread, but that's what a couple of the old-timers here told me. Super unfortunate.

@CLHatch
Copy link
Contributor

CLHatch commented Aug 7, 2023

Since this appears to be an issue of "Some use the episode_number value, some use the sort value", would a possible solution be to have a setting per podcast of which to use for our numbering? Maybe showing both values in the table so we could choose which is "closest" to what we want?

@Mbucari
Copy link
Collaborator

Mbucari commented Aug 7, 2023

@CLHatch Here's how Libation interprets the series order from Audible's sort and episode_number.

int lastEpNum = -1, dupeCount = 0;
foreach (var child in children.OrderBy(i => i.EpisodeNumber).ThenBy(i => i.PublicationDateTime))
{
string sequence;
if (child.EpisodeNumber is null)
{
// This should properly be Single() not FirstOrDefault(), but FirstOrDefault is defensive for malformed data from audible
sequence = parent.Relationships.FirstOrDefault(r => r.Asin == child.Asin)?.Sort?.ToString() ?? "0";
}
else
{
//multipart episodes may have the same episode number
if (child.EpisodeNumber == lastEpNum)
dupeCount++;
else
lastEpNum = child.EpisodeNumber.Value;
sequence = (lastEpNum + dupeCount).ToString();
}
// use parent's 'DateAdded'. DateAdded is just a convenience prop for: PurchaseDate.UtcDateTime
child.PurchaseDate = parent.PurchaseDate;
// parent is essentially a series
child.Series = new[]
{
new Series
{
Asin = parent.Asin,
Sequence = sequence,
Title = parent.TitleWithSubtitle
}
};
}

It's kind of complicated, and I think the code does a better job of explaining itself than I could with English.

@CLHatch
Copy link
Contributor

CLHatch commented Aug 7, 2023

@CLHatch Here's how Libation interprets the series order from Audible's sort and episode_number.

int lastEpNum = -1, dupeCount = 0;
foreach (var child in children.OrderBy(i => i.EpisodeNumber).ThenBy(i => i.PublicationDateTime))
{
string sequence;
if (child.EpisodeNumber is null)
{
// This should properly be Single() not FirstOrDefault(), but FirstOrDefault is defensive for malformed data from audible
sequence = parent.Relationships.FirstOrDefault(r => r.Asin == child.Asin)?.Sort?.ToString() ?? "0";
}
else
{
//multipart episodes may have the same episode number
if (child.EpisodeNumber == lastEpNum)
dupeCount++;
else
lastEpNum = child.EpisodeNumber.Value;
sequence = (lastEpNum + dupeCount).ToString();
}
// use parent's 'DateAdded'. DateAdded is just a convenience prop for: PurchaseDate.UtcDateTime
child.PurchaseDate = parent.PurchaseDate;
// parent is essentially a series
child.Series = new[]
{
new Series
{
Asin = parent.Asin,
Sequence = sequence,
Title = parent.TitleWithSubtitle
}
};
}

It's kind of complicated, and I think the code does a better job of explaining itself than I could with English.

I'll look at that in a bit, about to start cooking dinner. But from what I've seen, it appears the code is picking correctly for that HP series, but not for the other three I've tried so far. I'll add some screenshots of how it ordered them (the number at the beginning is from Libation, and the one in the title is what they are named).

This appears correct:
image

These appear be wrong:
image

image

image

@CLHatch
Copy link
Contributor

CLHatch commented Aug 7, 2023

@CLHatch Here's how Libation interprets the series order from Audible's sort and episode_number.

int lastEpNum = -1, dupeCount = 0;
foreach (var child in children.OrderBy(i => i.EpisodeNumber).ThenBy(i => i.PublicationDateTime))
{
string sequence;
if (child.EpisodeNumber is null)
{
// This should properly be Single() not FirstOrDefault(), but FirstOrDefault is defensive for malformed data from audible
sequence = parent.Relationships.FirstOrDefault(r => r.Asin == child.Asin)?.Sort?.ToString() ?? "0";
}
else
{
//multipart episodes may have the same episode number
if (child.EpisodeNumber == lastEpNum)
dupeCount++;
else
lastEpNum = child.EpisodeNumber.Value;
sequence = (lastEpNum + dupeCount).ToString();
}
// use parent's 'DateAdded'. DateAdded is just a convenience prop for: PurchaseDate.UtcDateTime
child.PurchaseDate = parent.PurchaseDate;
// parent is essentially a series
child.Series = new[]
{
new Series
{
Asin = parent.Asin,
Sequence = sequence,
Title = parent.TitleWithSubtitle
}
};
}

It's kind of complicated, and I think the code does a better job of explaining itself than I could with English.

So if I'm looking at that right, sort only comes into play if episode_number is null, correct? How about if we did like I suggested, and have the option to use sort INSTEAD of episode_number, on a per-podcast basis? Because it appears for those three that gave the incorrect ordering, doing that would fix them.

@AshbyGeek
Copy link
Author

AshbyGeek commented Aug 7, 2023 via email

@CLHatch
Copy link
Contributor

CLHatch commented Aug 7, 2023

If you give me a few quick hints on how to grab that metadata that includes the sort flag, I would collect that info for the podcasts I have listened to on audible so that we can do some more manual correlation before changing code.

On Mon, Aug 7, 2023, 7:37 PM CLHatch @.> wrote: @CLHatch https://github.com/CLHatch Here's how Libation interprets the series order from Audible's sort and episode_number.

int lastEpNum = -1, dupeCount = 0;
foreach (var child in children.OrderBy(i => i.EpisodeNumber).ThenBy(i => i.PublicationDateTime))
{
string sequence;
if (child.EpisodeNumber is null)
{
// This should properly be Single() not FirstOrDefault(), but FirstOrDefault is defensive for malformed data from audible
sequence = parent.Relationships.FirstOrDefault(r => r.Asin == child.Asin)?.Sort?.ToString() ?? "0";
}
else
{
//multipart episodes may have the same episode number
if (child.EpisodeNumber == lastEpNum)
dupeCount++;
else
lastEpNum = child.EpisodeNumber.Value;
sequence = (lastEpNum + dupeCount).ToString();
}
// use parent's 'DateAdded'. DateAdded is just a convenience prop for: PurchaseDate.UtcDateTime
child.PurchaseDate = parent.PurchaseDate;
// parent is essentially a series
child.Series = new[]
{
new Series
{
Asin = parent.Asin,
Sequence = sequence,
Title = parent.TitleWithSubtitle
}
};
}
It's kind of complicated, and I think the code does a better job of explaining itself than I could with English. So if I'm looking at that right, sort only comes into play if episode_number is null, correct? How about if we did like I suggested, and have the option to use sort INSTEAD of episode_number, an a per-podcast basis? Because it appears for those three that gave the incorrect ordering, doing that would fix them. — Reply to this email directly, view it on GitHub <#600 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAUI2FKS3QXS3ZKMOWDHQLXUF33NANCNFSM6AAAAAAX75YTCU . You are receiving this because you were mentioned.Message ID: @.>

Good idea. I've literally just started looking at the podcasts for one or two days here. :-D

One way to check the sort value would be to check the option in this screenshot, and have Libation grab them. Then look at the <filename>.metadata.json file it creates alongside the audio file.
image

@AshbyGeek
Copy link
Author

AshbyGeek commented Aug 7, 2023 via email

@Mbucari
Copy link
Collaborator

Mbucari commented Aug 8, 2023

So if I'm looking at that right, sort only comes into play if episode_number is null, correct?

Basically right.

How about if we did like I suggested, and have the option to use sort INSTEAD of episode_number, on a per-podcast basis? Because it appears for those three that gave the incorrect ordering, doing that would fix them.

I don't have a problem with that on principle, I just don't know how to work it into the UI. Maybe a context menu item on podcasts, but it's such a niche option and only power users would have any idea what the hell it even means.

@CLHatch
Copy link
Contributor

CLHatch commented Aug 8, 2023

How about if we did like I suggested, and have the option to use sort INSTEAD of episode_number, on a per-podcast basis? Because it appears for those three that gave the incorrect ordering, doing that would fix them.

I don't have a problem with that on principle, I just don't know how to work it into the UI. Maybe a context menu item on podcasts, but it's such a niche option and only power users would have any idea what the hell it even means.

A context menu on the parent podcast item was what I was thinking of. And true, definitely a "power user" option, but I'm thinking one we sort of need, if we want to try to get podcast episodes ordered right. I have a feeling there will still be outliers that it still won't fix, but I'm also hoping it will fix the majority of them, having an option like that.

@AshbyGeek
Copy link
Author

Ok, here's an example of why trusting the 'episode number' is dangerous (rehashed for old-timers, but worth noting again). I chopped out non-pertinent parts of the metadata.json

Intentionally Blank - Episode 1 "Popcornture vs Stubad"

{
  "asin": "B096NT8C9Q",
  "content_delivery_type": "PodcastEpisode",
  "content_type": "Podcast",
  "episode_number": 1,
  "episode_type": "full",
  "format_type": "original_recording",
  "generic_keyword": "38ca95da-2a62-4d9c-88e2-cddc5b1e9172",
  "issue_date": "2021-06-09",
  "publisher_summary": "<p>The opening episode of Intentionally Blank begins in terribad fashion as Brandon and Dan search for the perfect podcast name and share their thoughts on The Snyder Cut, artists changing their art, and a bit about Jeopardy.</p>",
  "relationships": [
    {
      "asin": "B08JJPHMBY",
      "content_delivery_type": "PodcastParent",
      "relationship_to_product": "parent",
      "relationship_type": "episode",
      "sku": "PD_8001_094639",
      "sku_lite": "PD_8001_094639",
      "sort": "1",
      "title": "Intentionally Blank",
      "url": "/pd/item_name-Podcast/B08JJPHMBY"
    },
    {
      "asin": "B08LGB7LV5",
      "content_delivery_type": "PodcastSeason",
      "relationship_to_product": "parent",
      "relationship_type": "episode",
      "sku": "PS_8001_667569",
      "sku_lite": "PS_8001_667569",
      "sort": "1",
      "title": "season 1",
      "url": "/pd/ITEM_NAME-Podcast/B08LGB7LV5"
    }
  ],
  "release_date": "2021-06-09",
  "runtime_length_min": 52,
  "season_number": 1,
  "sku": "PC_800F_646162",
  "sku_lite": "PC_800F_646162",
  "title": "Popcornture vs Stubad",
}

Episode 53 - "I Can't Give You a Hemi"

{
  "asin": "B0B3JTPW6T",
  "content_delivery_type": "PodcastEpisode",
  "content_type": "Podcast",
  "episode_number": 1,
  "episode_type": "full",
  "format_type": "original_recording",
  "generic_keyword": "0ce65085-1f84-466e-94db-1a2029e017a6",
  "issue_date": "2022-06-08",
  "publication_datetime": "2022-06-08T16:00:00Z",
  "publisher_summary": "<p>Brandon and Dan start off with another historical food heist before moving on to discuss their book titles and other naming conventions in books and films. Including a tangent involving a fake listing of Brandon’s epic, The Way of Kings.</p><p><br /></p><p>You can join the discussion and vote for your favorite podcast title at r/sanderson: https://www.reddit.com/r/Sanderson/</p><p><br /></p><p>Can be listened to almost everywhere podcasts can be found.</p><p><br /></p><p>Produced by Adam Horne</p><p><br /></p><p>Sound engineering and editing by Daniel Thompson</p>",
  "relationships": [
    {
      "asin": "B08JJPHMBY",
      "content_delivery_type": "PodcastParent",
      "relationship_to_product": "parent",
      "relationship_type": "episode",
      "sku": "PD_8001_094639",
      "sku_lite": "PD_8001_094639",
      "sort": "53",
      "title": "Intentionally Blank",
      "url": "/pd/item_name-Podcast/B08JJPHMBY"
    },
    {
      "asin": "B0B46WRCT1",
      "content_delivery_type": "PodcastSeason",
      "relationship_to_product": "parent",
      "relationship_type": "episode",
      "sku": "PS_8002_179041",
      "sku_lite": "PS_8002_179041",
      "sort": "1",
      "title": "season 2",
      "url": "/pd/season-2-Podcast/B0B46WRCT1"
    }
  ],
  "release_date": "2022-06-08",
  "runtime_length_min": 35,
  "season_number": 2,
  "sku": "PC_800W_568292",
  "sku_lite": "PC_800W_568292",
  "title": "I Can’t Give You a Hemi!",
}

Audible does show "I can't give you a Hemi" as approximately episode 53. I'm really not sure what's going on with the 'Season' numbers though.

Here's another later episode for comparison in case it is somehow pertinent:

{
  "asin": "B0CDFGNMGG",
  "asset_details": [],
  "category_ladders": [],
  "content_delivery_type": "PodcastEpisode",
  "content_type": "Podcast",
  "episode_type": "full",
  "format_type": "original_recording",
  "generic_keyword": "354671cc-314f-4816-837e-c3e652bd382c","publication_datetime": "2023-08-02T18:00:00Z",
  "publisher_summary": "<p>Brandon and Dan talk about Dan's struggle with depression and the in and out's of the world's view on mental health.<br /><br />🍔 Food Heists:<br /><br />Stealing Alligator Eggs, for a Secret Alligator Ranch, During a Hurricane\"- https://youtu.be/fZuDOxj0YSE (0:00-9:30)<br /><br />vs<br /><br />“The Snackyderms.”Elephants with diplomatic immunity make-off with sugarcane  -  https://youtu.be/xOZPEQ2SLjw?t=102 (1:42-10:10)<br /><br />🔥 Bad Story Ideas:<br /><br />\"Jack the Carjacking Car; Cold Open: Fuel as Food!\" - https://youtu.be/fZuDOxj0YSE?t=538 (8:58-14:05)<br /><br />vs<br /><br />\"Planetary Shenanigans or Sisyphus Plays Katamari Damacy\" - https://youtu.be/w1KDsehTGYs?t=4 (0:04-6:33)<br /><br />And make sure to cast your vote on this week's polls by clicking the Google form below: https://docs.google.com/forms/d/e/1FAIpQLSdhm-HWXLC6y35tBMO1JftDq3rZEbTvw2_Iaty_LADG4RDAEQ/viewform<br /><br />Which stories and heists will emerge victorious! Join us next week to find out!<br /><br />Check out our previous episode of Intentionally Blank<br />https://youtu.be/V14neRxSzD0<br /><br />Can be listened to almost everywhere podcasts can be found.<br /><br />Sound engineering and editing by Daniel Thompson</p>","relationships": [
    {
      "asin": "B08JJPHMBY",
      "content_delivery_type": "PodcastParent",
      "relationship_to_product": "parent",
      "relationship_type": "episode",
      "sku": "PD_8001_094639",
      "sku_lite": "PD_8001_094639",
      "sort": "112",
      "title": "Intentionally Blank",
      "url": "/pd/item_name-Podcast/B08JJPHMBY"
    },
    {
      "asin": "B08JJPVCX9",
      "content_delivery_type": "PodcastSeason",
      "relationship_to_product": "parent",
      "relationship_type": "episode",
      "sku": "PS_8001_199025",
      "sku_lite": "PS_8001_199025",
      "sort": "40",
      "title": "season -1",
      "url": "/pd/item_name-Podcast/B08JJPVCX9"
    }
  ],
  "release_date": "2023-08-02",
  "runtime_length_min": 28,
  "sku": "PC_801L_381983",
  "sku_lite": "PC_801L_381983",
  "title": "Depression — Ep. 113 of Intentionally Blank",
}

Different podcast (Harry Potter and the Methods of Rationality)

Episode 1

{
  "asin": "B09DB1ZXV4",
  "asset_details": [],
  "category_ladders": [],
  "content_delivery_type": "PodcastEpisode",
  "content_type": "Podcast",
  "episode_number": 1,
  "episode_type": "full",
  "format_type": "original_recording",
  "generic_keyword": "960d44ff-0acf-4ae6-afdd-31ec79814514",
  "publication_datetime": "2021-08-21T19:36:05Z",
  "publisher_summary": "<p>All rights belong to J.K Rowling. This is a fan fiction written by Eliezer Yudkowsky.</p> <p>I am Jack Voraces, a professional audiobook narrator:</p> <p>https://www.audible.com/search?searchNarrator=Jack+Voraces</p> <p>I do not intend to make any money from this podcast. It is a free audiobook for anyone to listen to and it is my hope that it will eventually evolve into a dream I have had for a while. The 500 hour audiobook. I would like to create an audiobook that is 500 hours long, totally free and available in multiple formats. The author has given permission for this recording and if you enjoyed Mother of Learning, you will likely enjoy this too. </p> <p>Each chapter is recorded live on Discord on Mondays at 20:00 BST:</p> <p>https://discord.gg/6B5hJdx</p> <p> Please do come and join us</p>",
  "relationships": [
    {
      "asin": "B08JJPXGYQ",
      "content_delivery_type": "PodcastSeason",
      "relationship_to_product": "parent",
      "relationship_type": "episode",
      "sku": "PS_8001_125058",
      "sku_lite": "PS_8001_125058",
      "sort": "110",
      "title": "season -1",
      "url": "/pd/season-1-Podcast/B08JJPXGYQ"
    },
    {
      "asin": "B08JJPRMKH",
      "content_delivery_type": "PodcastParent",
      "relationship_to_product": "parent",
      "relationship_type": "episode",
      "sku": "PD_8001_110871",
      "sku_lite": "PD_8001_110871",
      "sort": "110",
      "title": "Harry Potter and The Methods of Rationality Audiobook",
      "url": "/pd/Book-to-New-Worlds-A-DD-Audiobook-Narrated-by-Jack-Voraces-Podcast/B08JJPRMKH"
    }
  ],
  "release_date": "2021-08-21",
  "runtime_length_min": 24,
  "sku": "PC_800J_079158",
  "sku_lite": "PC_800J_079158",
  "title": "Chapter 1: A Day of Very Low Probability",
}

Episode 2

{
  "asin": "B09D9Z6WR8",
  "asset_details": [],
  "category_ladders": [],
  "content_delivery_type": "PodcastEpisode",
  "content_type": "Podcast",
  "episode_number": 2,
  "episode_type": "full",
  "format_type": "original_recording",
  "generic_keyword": "109ce8f3-f2cf-4aa1-9dd1-1bc178184be9","publication_datetime": "2021-08-21T19:37:31Z",
  "publisher_summary": "<p>All rights belong to J.K Rowling. This is a fan fiction written by Eliezer Yudkowsky.</p> <p>I am Jack Voraces, a professional audiobook narrator:</p> <p>https://www.audible.com/search?searchNarrator=Jack+Voraces</p> <p>I do not intend to make any money from this podcast. It is a free audiobook for anyone to listen to and it is my hope that it will eventually evolve into a dream I have had for a while. The 500 hour audiobook. I would like to create an audiobook that is 500 hours long, totally free and available in multiple formats. The author has given permission for this recording and if you enjoyed Mother of Learning, you will likely enjoy this too. </p> <p>Each chapter is recorded live on Discord on Mondays at 20:00 BST:</p> <p>https://discord.gg/6B5hJdx</p> <p> Please do come and join us</p>","relationships": [
    {
      "asin": "B08JJPXGYQ",
      "content_delivery_type": "PodcastSeason",
      "relationship_to_product": "parent",
      "relationship_type": "episode",
      "sku": "PS_8001_125058",
      "sku_lite": "PS_8001_125058",
      "sort": "109",
      "title": "season -1",
      "url": "/pd/season-1-Podcast/B08JJPXGYQ"
    },
    {
      "asin": "B08JJPRMKH",
      "content_delivery_type": "PodcastParent",
      "relationship_to_product": "parent",
      "relationship_type": "episode",
      "sku": "PD_8001_110871",
      "sku_lite": "PD_8001_110871",
      "sort": "109",
      "title": "Harry Potter and The Methods of Rationality Audiobook",
      "url": "/pd/Book-to-New-Worlds-A-DD-Audiobook-Narrated-by-Jack-Voraces-Podcast/B08JJPRMKH"
    }
  ],
  "release_date": "2021-08-21",
  "runtime_length_min": 14,
  "sku": "PC_800J_079561",
  "sku_lite": "PC_800J_079561",
  "title": "Chapter 2: Everything I Believe Is False",
}

and a very recent episode

{
  "asin": "B0CCN2PRQ2",
  "asset_details": [],
  "category_ladders": [],
  "content_delivery_type": "PodcastEpisode",
  "content_type": "Podcast",
  "episode_number": 108,
  "episode_type": "full",
  "format_type": "original_recording",
  "generic_keyword": "544c0488-7153-40ac-87cb-4dece495e814",
  "publication_datetime": "2023-08-04T11:31:31Z",
  "publisher_summary": "<p>All rights belong to J.K Rowling. This is a Harry Potter fan fiction written by Eliezer Yudkowsky.</p> <p>I am Jack Voraces, a professional audiobook narrator:</p> <p>https://www.audible.com/search?searchNarrator=Jack+Voraces</p> <p>I do not intend to make any money from this podcast. It is a free audiobook for anyone to listen to and it is my hope that it will eventually evolve into a dream I have had for a while. The 500 hour audiobook. I would like to create an audiobook that is 500 hours long, totally free and available in multiple formats. The author has given permission for this recording and if you enjoyed Mother of Learning, you will likely enjoy this too. </p> <p>Each chapter is recorded live on Discord on Mondays at 20:00 GMT:</p> <p>https://discord.gg/6B5hJdx</p>",
  "relationships": [
    {
      "asin": "B08JJPXGYQ",
      "content_delivery_type": "PodcastSeason",
      "relationship_to_product": "parent",
      "relationship_type": "episode",
      "sku": "PS_8001_125058",
      "sku_lite": "PS_8001_125058",
      "sort": "1",
      "title": "season -1",
      "url": "/pd/season-1-Podcast/B08JJPXGYQ"
    },
    {
      "asin": "B08JJPRMKH",
      "content_delivery_type": "PodcastParent",
      "relationship_to_product": "parent",
      "relationship_type": "episode",
      "sku": "PD_8001_110871",
      "sku_lite": "PD_8001_110871",
      "sort": "1",
      "title": "Harry Potter and The Methods of Rationality Audiobook",
      "url": "/pd/Book-to-New-Worlds-A-DD-Audiobook-Narrated-by-Jack-Voraces-Podcast/B08JJPRMKH"
    }
  ],
  "release_date": "2023-08-04",
  "runtime_length_min": 23,
  "sku": "PC_801K_989263",
  "sku_lite": "PC_801K_989263",
  "title": "Chapter 103: Tests",
}

It is interesting to note that on this podcast Audible itself seems to be confused as listing episodes from "old to new" puts episode 103 (the latest) at the top of the list. No such problem for the "Intentionally Blank" podcast.


Here's a third podcast I listen to "Follow Him: A Come Follow Me Podcast"

{
  "asin": "B09P7SR4MK",
  "asset_details": [],
  "category_ladders": [],
  "content_delivery_type": "PodcastEpisode",
  "content_type": "Podcast",
  "episode_number": 1,
  "episode_type": "full",
  "format_type": "original_recording",
  "generic_keyword": "4450aeb6-b2c2-43ed-97b3-2ed5ca62a697",
  "publication_datetime": "2021-12-27T01:00:00Z",
  "publisher_summary": "<p>Are you one of the few that already love the Old Testament or one of the few that hope to love the Old Testament? Join Dr. Kerry Muhlestein as we discuss techniques for studying Moses 1, Abraham 3, and the Old Testament. We learn how to view the Creation through new eyes, and you will see the story as never before.<br /><br />Show Notes (English, French, Spanish, Portuguese): https://followhim.co/episodes<br />Facebook: https://www.facebook.com/followhimpodcast<br />Instagram: https://www.instagram.com/followhimpodcast<br />YouTube: https://www.youtube.com/c/FollowHimOfficialChannel<br /><br />Thanks to the followHIM team:<br />Steve & Shannon Sorensen: Executive Producers<br />Dr. Hank Smith: Co-host<br />John Bytheway: Co-host<br />David Perry: Producer<br />Kyle Nelson: Marketing<br />Lisa Spice: Client Relations, Show Notes/Transcripts<br />Jamie Neilson: Social Media, Graphic Design<br />Will Stoughton: Rough Video Editor<br />Ariel Cuadra: Spanish Transcripts<br />Krystal Roberts: French Transcripts<br />Igor Willians: Portuguese Transcripts<br /><br />\"Let Zion in Her Beauty Rise\" by Marshall McDonald<br />https://www.marshallmcdonaldmusic.com/products/let-zion-in-her-beauty-rise-piano<br /><br />Please rate and review the podcast.</p>",
  "relationships": [
    {
      "asin": "B09P7T1JQW",
      "content_delivery_type": "PodcastSeason",
      "relationship_to_product": "parent",
      "relationship_type": "episode",
      "sku": "PS_8001_881335",
      "sku_lite": "PS_8001_881335",
      "sort": "1",
      "title": "season 2",
      "url": "/pd/season-2-Podcast/B09P7T1JQW"
    },
    {
      "asin": "B08JJN19M6",
      "content_delivery_type": "PodcastParent",
      "relationship_to_product": "parent",
      "relationship_type": "episode",
      "sku": "PD_8001_003936",
      "sku_lite": "PD_8001_003936",
      "sort": "144",
      "title": "Follow Him: A Come, Follow Me Podcast",
      "url": "/pd/Follow-Him-A-Come-Follow-Me-Podcast-featuring-Hank-Smith-John-Bytheway-Podcast/B08JJN19M6"
    }
  ],
  "release_date": "2021-12-27",
  "runtime_length_min": 69,
  "season_number": 2,
  "sku": "PC_800O_577068",
  "sku_lite": "PC_800O_577068",
  "title": "Moses 1; Abraham 3 -- Part 1 : Dr. Kerry Muhlestein",
}

This one is actually probably episode 144 of that podcast, I didn't want to actually count that many items down the screen (after I finally found it), but that seems approximately right. No funny business with the sort order on the audible page on this one though.

Here's another episode for comparison.

{
  "asin": "B08RMPMRKH",
  "asset_details": [],
  "category_ladders": [],
  "content_delivery_type": "PodcastEpisode",
  "content_type": "Podcast",
  "episode_number": 2,
  "episode_type": "full",
  "format_type": "original_recording",
  "generic_keyword": "13abcaf2-5a18-4e78-8370-b927be67e68d",
  "publication_datetime": "2021-01-03T08:00:00Z",
  "publisher_summary": "<p>Did you know that the story of the First Vision is the second greatest story ever told?  BYU Professor, Historian, and Editor, Dr. Steven Harper, takes us on a deep-dive into Joseph Smith History.  From Joseph's humble beginnings to facing overwhelming odds, we see Joseph Smith as the hero of a great story, one that includes each one of us.</p><p>Part I focuses on the context of Joseph Smith's childhood, family relations and religious influences that culminates in the first vision and Part II focuses on the First Vision.</p>",
  "relationships": [
    {
      "asin": "B08K58GQVX",
      "content_delivery_type": "PodcastSeason",
      "relationship_to_product": "parent",
      "relationship_type": "episode",
      "sku": "PS_8001_418308",
      "sku_lite": "PS_8001_418308",
      "sort": "2",
      "title": "season 1",
      "url": "/pd/season-1-Podcast/B08K58GQVX"
    },
    {
      "asin": "B08JJN19M6",
      "content_delivery_type": "PodcastParent",
      "relationship_to_product": "parent",
      "relationship_type": "episode",
      "sku": "PD_8001_003936",
      "sku_lite": "PD_8001_003936",
      "sort": "2",
      "title": "Follow Him: A Come, Follow Me Podcast",
      "url": "/pd/Follow-Him-A-Come-Follow-Me-Podcast-featuring-Hank-Smith-John-Bytheway-Podcast/B08JJN19M6"
    }
  ],
  "release_date": "2021-01-03",
  "runtime_length_min": 33,
  "season_number": 1,
  "sku": "PC_8009_921671",
  "sku_lite": "PC_8009_921671",
  "title": "Joseph Smith History 1:1-26: Dr. Steven Harper: Part I",
}

I looked at a couple other episodes of this podcast and it might be that it is out of order because the 'season_number' field is ignored by Libation. Probably should make that a new issue though.


Summing up

  • Libation needs a column for 'podcast season' or meld that in with 'Series Order' (maybe show it as s1e1 or something or just compute it into the 'Series Order number'). Regardless, seems like there's lost opportunity here.
  • Of the items I looked at, "sort" order for relationships->"content_delivery_type": "PodcastParent" was most reliable, except that HPMOR is weird and backwards, even on Audible's page. This was true regardless of use of the "season_number" field.

@AshbyGeek
Copy link
Author

AshbyGeek commented Aug 8, 2023

One more podcast I went and grabbed at random just for comparison:

"official trailer"

{
  "asin": "B0BL839FS2",
  "asset_details": [],
  "category_ladders": [],
  "content_delivery_type": "PodcastEpisode",
  "content_type": "Podcast",
  "episode_type": "trailer",
  "format_type": "original_recording",
  "generic_keyword": "c4ab4cd9-683a-4ac2-b855-a4489a146ba4",
  "publication_datetime": "2022-11-02T23:19:25Z",
  "relationships": [
    {
      "asin": "B0BL875WNG",
      "content_delivery_type": "PodcastSeason",
      "relationship_to_product": "parent",
      "relationship_type": "episode",
      "sku": "PS_8002_401193",
      "sku_lite": "PS_8002_401193",
      "sort": "1",
      "title": "season -1",
      "url": "/pd/season-1-Podcast/B0BL875WNG"
    },
    {
      "asin": "B0BL7X9C15",
      "content_delivery_type": "PodcastParent",
      "relationship_to_product": "parent",
      "relationship_type": "episode",
      "sku": "PD_8001_569998",
      "sku_lite": "PD_8001_569998",
      "sort": "1",
      "title": "The Callisto Protocol: Helix Station",
      "url": "/pd/The-Callisto-Protocol-Helix-Station-Podcast/B0BL7X9C15"
    }
  ],
  "release_date": "2022-11-02",
  "runtime_length_min": 3,
  "sku": "PC_8013_502440",
  "sku_lite": "PC_8013_502440",
  "title": "Official Trailer | The Callisto Protocol: Helix Station",

No "season_number" field on this podcast episode.

Episode 1

{
  "asin": "B0BL8DS729",
  "asset_details": [],
  "category_ladders": [],
  "content_delivery_type": "PodcastEpisode",
  "content_type": "Podcast",
  "episode_number": 1,
  "episode_type": "full",
  "format_type": "original_recording",
  "generic_keyword": "0bf3103e-cb6c-4ab5-b652-c8f37b525fce",
  "publication_datetime": "2022-11-03T04:00:00Z",
  "relationships": [
    {
      "asin": "B0BL875WNG",
      "content_delivery_type": "PodcastSeason",
      "relationship_to_product": "parent",
      "relationship_type": "episode",
      "sku": "PS_8002_401193",
      "sku_lite": "PS_8002_401193",
      "sort": "2",
      "title": "season -1",
      "url": "/pd/season-1-Podcast/B0BL875WNG"
    },
    {
      "asin": "B0BL7X9C15",
      "content_delivery_type": "PodcastParent",
      "relationship_to_product": "parent",
      "relationship_type": "episode",
      "sku": "PD_8001_569998",
      "sku_lite": "PD_8001_569998",
      "sort": "2",
      "title": "The Callisto Protocol: Helix Station",
      "url": "/pd/The-Callisto-Protocol-Helix-Station-Podcast/B0BL7X9C15"
    }
  ],
  "release_date": "2022-11-03",
  "runtime_length_min": 27,
  "sku": "PC_8013_488065",
  "sku_lite": "PC_8013_488065",
  "title": "Episode 1 | The Proposition",
}

Episode 2

{
  "asin": "B0BL8863V2",
  "asset_details": [],
  "category_ladders": [],
  "content_delivery_type": "PodcastEpisode",
  "content_type": "Podcast",
  "episode_number": 2,
  "episode_type": "full",
  "format_type": "original_recording",
  "generic_keyword": "46a5cb39-fadf-4f74-a152-46e37fe52853",
  "publication_datetime": "2022-11-03T04:05:00Z",
  "relationships": [
    {
      "asin": "B0BL875WNG",
      "content_delivery_type": "PodcastSeason",
      "relationship_to_product": "parent",
      "relationship_type": "episode",
      "sku": "PS_8002_401193",
      "sku_lite": "PS_8002_401193",
      "sort": "3",
      "title": "season -1",
      "url": "/pd/season-1-Podcast/B0BL875WNG"
    },
    {
      "asin": "B0BL7X9C15",
      "content_delivery_type": "PodcastParent",
      "relationship_to_product": "parent",
      "relationship_type": "episode",
      "sku": "PD_8001_569998",
      "sku_lite": "PD_8001_569998",
      "sort": "3",
      "title": "The Callisto Protocol: Helix Station",
      "url": "/pd/The-Callisto-Protocol-Helix-Station-Podcast/B0BL7X9C15"
    }
  ],
  "release_date": "2022-11-03",
  "runtime_length_min": 28,
  "sku": "PC_8013_507678",
  "sku_lite": "PC_8013_507678",
  "title": "Episode 2 | Shipwrecks",
}

Maybe "season_number" only shows up if the podcast has more than 1 season listed?

@MoSattler
Copy link

I still have the issue that the podcast order is not correct (it's just random). https://www.audible.es/pd/Por-que-matamos-Podcast/B093ZPF63V?qid=1701450664&sr=1-1&ref_pageloadid=not_applicable&ref=a_search_c3_lProduct_1_1&pf_rd_p=edc39886-a4e3-4991-8ce5-effa92157a44&pf_rd_r=G1QFDYKMND9K7T3ZZDN4&pageLoadId=5rR7m0m7NBuLA9XW&ref_plink=not_applicable&creativeId=41e85e98-10b8-40e2-907d-6b663f04a42d

Is there any way around this where I can use the pub date?

Also, the metadata doesnt seem to be correctly encoded. E.g. publication date is missing altogether in the resulting m4b files.

@CLHatch
Copy link
Contributor

CLHatch commented Dec 1, 2023

I still have the issue that the podcast order is not correct (it's just random). https://www.audible.es/pd/Por-que-matamos-Podcast/B093ZPF63V?qid=1701450664&sr=1-1&ref_pageloadid=not_applicable&ref=a_search_c3_lProduct_1_1&pf_rd_p=edc39886-a4e3-4991-8ce5-effa92157a44&pf_rd_r=G1QFDYKMND9K7T3ZZDN4&pageLoadId=5rR7m0m7NBuLA9XW&ref_plink=not_applicable&creativeId=41e85e98-10b8-40e2-907d-6b663f04a42d

Is there any way around this where I can use the pub date?

Also, the metadata doesnt seem to be correctly encoded. E.g. publication date is missing altogether in the resulting m4b files.

Yeah, most the podcasts I've looked at it ends up being completely random. He fixed one podcast, but others are broken. It seems everyone orders them using a different method?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants