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

Bug in reading pubDate from TRD #249

Closed
terotil opened this issue Jan 8, 2021 · 1 comment
Closed

Bug in reading pubDate from TRD #249

terotil opened this issue Jan 8, 2021 · 1 comment

Comments

@terotil
Copy link
Contributor

terotil commented Jan 8, 2021

When id3v2 field TRD is non-empty, dropcaster tries to parse pubDate from that field, but unfortunately there's a typo in the parse line and it is looking for nonexistent field TDR. I'm suggesting following change (fix typo and use v2.3 field names)

diff --git a/lib/dropcaster/item.rb b/lib/dropcaster/item.rb
index 323afa8..5b8df16 100644
--- a/lib/dropcaster/item.rb
+++ b/lib/dropcaster/item.rb
@@ -27,11 +27,11 @@ module Dropcaster
       @file_size = File.new(file_path).stat.size
       @uuid = Digest::SHA1.hexdigest(File.read(file_path))
 
-      if tag2.TRD.blank?
+      if tag2.TRDA.blank?
         logger.info("#{file_path} has no pub date set, using the file's modification time")
         @pub_date = Time.parse(File.new(file_path).mtime.to_s)
       else
-        @pub_date = Time.parse(tag2.TDR)
+        @pub_date = Time.parse(tag2.TRDA)
       end
     end
   end
@stephenwade
Copy link
Collaborator

Thanks @terotil!

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

No branches or pull requests

2 participants