Skip to content

Commit

Permalink
Make DESCRIPTION_SOURCE into a class var too. I can see I'm going to …
Browse files Browse the repository at this point in the history
…be doing this a lot.
  • Loading branch information
ben-xo committed Feb 13, 2021
1 parent 2ad4f2a commit a306a3e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion dir2cast.php
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,7 @@ public function getImage()
class Media_RSS_Item extends RSS_File_Item implements Serializable {

static $LONG_TITLES = false;
static $DESCRIPTION_SOURCE = 'comment';

public function __construct($filename)
{
Expand Down Expand Up @@ -810,7 +811,7 @@ 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')
if(self::$DESCRIPTION_SOURCE == 'summary' || self::$DESCRIPTION_SOURCE == 'file')
return parent::getSummary(); // call to parent because otherwise we could co-recurse.

return $this->getID3Comment();
Expand Down Expand Up @@ -1811,6 +1812,7 @@ public function init()
$itunes = $podcast->addHelper(new iTunes_Podcast_Helper());

Media_RSS_Item::$LONG_TITLES = LONG_TITLES;
Media_RSS_Item::$DESCRIPTION_SOURCE = DESCRIPTION_SOURCE;

$podcast->setTitle(TITLE);
$podcast->setLink(LINK);
Expand Down
2 changes: 1 addition & 1 deletion test/Media_RSS_ItemTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public static function setUpBeforeClass(): void
{
RSS_File_ItemTest::setUpBeforeClass();
Media_RSS_Item::$LONG_TITLES = false;
defined('DESCRIPTION_SOURCE') || define('DESCRIPTION_SOURCE', 'comment');
Media_RSS_Item::$DESCRIPTION_SOURCE = 'comment';
}

public function getMediaFileContent()
Expand Down

0 comments on commit a306a3e

Please sign in to comment.