ben-xo / dir2cast

Turn a directory of MP3s into a podcast - automatically.
http://www.ben-xo.com/dir2cast
BSD 3-Clause "New" or "Revised" License
152 stars 20 forks source link

Duplicated item attributes #62

Closed EdwarDDay closed 2 years ago

EdwarDDay commented 2 years ago

In my rss feed, all the attributes in the itunes namespace are duplicated for all item elements.

Maybe it has something to do with the podcast episodes being in a subfolder.

Example:

<item>
  <itunes:author>Author</itunes:author>
  <itunes:duration>0:30:00</itunes:duration>
  <itunes:summary>The summary</itunes:summary>
  <itunes:subtitle>Author</itunes:subtitle>
  <itunes:image href="https://example.com/podcast/Episode_1.jpg"/>
  <itunes:author>Author</itunes:author><!--here starts the duplicated element-->
  <itunes:duration>0:30:00</itunes:duration>
  <itunes:summary>The summary</itunes:summary>
  <itunes:subtitle>Author</itunes:subtitle>
  <itunes:image href="https://example.com/podcast/Episode_1.jpg"/>
  <title>Episode 1</title>
  <link>https://example.com/podcast/Episode_1.mp3</link>
  <pubDate>Sat, 20 Aug 2022 12:00:00 +0000</pubDate>
  <description><![CDATA[]]></description>
  <image>https://example.com/podcast/Episode_1.jpg</image>
  <enclosure url="https://example.com/podcast/Episode_1.mp3" length="10000" type="audio/mpeg"/>
</item>
ben-xo commented 2 years ago

This is curious! It should also be harmless, but I'll see if I can reproduce the problem

ben-xo commented 2 years ago

So… i managed to reproduce this once… then couldn't reproduce it again. Very strange…

ben-xo commented 2 years ago

Hah, I did manage to reproduce it, and it's a weird one. It does not matter if RECURSIVE_DIRECTORY_ITERATOR is enabled or not.

Steps to reproduce step 1) put some podcast mp3s with embedded cover art in a folder. Make sure that there are NOT any cover art files adjacent to the audio files. step 2) view them with dir2cast.php once. The output will be correct, and covert art files will also be output adjacent to the audio files. step 3) wait about 5 seconds (there is a minimum validity on the cache files for performance) step 4) view them a second time with dir2cast.php. Observe the duplicate tags!

It only happens if you perform step 1 with no art files.

The good news is there's an easy workaround; wipe the temp folder and view the podcast again, and it will be correct.

Whilst testing this I also discovered that you can mess things up in other ways by manipulating the timestamps, so i'll look into this area. Sigh!

ben-xo commented 2 years ago

Fixed it, please try the latest version 👍

EdwarDDay commented 2 years ago

Looks like it's working now. Thank you. I will monitor it and see, if it happens again.