ShephedProject / shepherd

Shepherd delivers reliable, high-quality Australian TV guide data (EPG).
Other
20 stars 14 forks source link

Alternative to repacking DateTime::Format::XMLTV using XMLTV:Date and… #6

Closed perkins1724 closed 5 years ago

perkins1724 commented 6 years ago

… time_iso_to_xmltv function.

thiakil commented 6 years ago

Really those lines could be replaced with

sub format_datetime 
{   
  my ($self, $dt) = @_; 

  return($dt->ymd('') . $dt->hms('') . ' ' .    
         DateTime::TimeZone->offset_as_string($dt->offset));    
}

from the package. The rest of it is documentation and parsing. Not sure I really see the issue with repacking anyway, it's so that the grabber will just work without having to download a new dep

perkins1724 commented 6 years ago

Really those lines could be replaced with


sub format_datetime 
{   
my ($self, $dt) = @_; 

return($dt->ymd('') . $dt->hms('') . ' ' .
DateTime::TimeZone->offset_as_string($dt->offset));
}


>from the package. 

Pretty much. It is just formatting.

>Not sure I really see the issue with repacking anyway, it's so that the grabber will just work without having to download a new dep

If it is really genuinely needed then better to just add the dependency IMO rather than copy whole modules. However if the project is going to work across multiple OS then additional dependencies should only be added where absolutely necessary. In this case it is just basically formatting so there are far easier and lighter ways.