Skip to content

Commit

Permalink
Don't gate the default summary coming from the description if LONG_TI…
Browse files Browse the repository at this point in the history
…TLES is set (why?) and fix potential infinite recursion if DESCRIPTION_SOURCE=summary and there's no summary file.
  • Loading branch information
ben-xo committed Feb 13, 2021
1 parent 31a59d8 commit c5fb88b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions dir2cast.php
Original file line number Diff line number Diff line change
Expand Up @@ -811,15 +811,15 @@ public function getDescription()
// The default value is "comment". dir2cast prior to v1.19
// used value "file", so it's here for backward compatibility
if(DESCRIPTION_SOURCE == 'summary' || DESCRIPTION_SOURCE == 'file')
return $this->getSummary();
return parent::getSummary(); // call to parent because otherwise we could co-recurse.

return $this->getID3Comment();
}

public function getSummary()
{
$summary = parent::getSummary();
if(null == $summary && !self::$LONG_TITLES)
if(!$summary)
{
// use description as summary if there's no file-based override
$summary = $this->getDescription();
Expand All @@ -830,9 +830,10 @@ public function getSummary()
public function getSubtitle()
{
$subtitle = parent::getSubtitle();
if(null == $subtitle && !self::$LONG_TITLES)
if(!$subtitle && !self::$LONG_TITLES)
{
// use artist as subtitle if there's no file-based override
// but not if LONG_TITLES is set (as it's already in the title)
$subtitle = $this->getID3Artist();
}
return $subtitle;
Expand Down

0 comments on commit c5fb88b

Please sign in to comment.