Change the name of the epub downloaded to Author - Title.

This commit is contained in:
Sébastien Lucas 2013-01-31 14:30:04 +01:00
parent 52393002b0
commit 6c5aed67b7
2 changed files with 13 additions and 1 deletions

View File

@ -318,7 +318,7 @@ class Book extends Base {
$epub->Serie ($se->name);
$epub->SerieIndex ($this->seriesIndex);
}
$epub->download ($data->getFilename ());
$epub->download ($data->getUpdatedFilenameEpub ());
}
catch (Exception $e)
{

View File

@ -70,6 +70,18 @@ class Data extends Base {
return $this->name . "." . strtolower ($this->format);
}
public function getUpdatedFilename () {
return $this->book->getAuthorsName () . " - " . $this->book->title;
}
public function getUpdatedFilenameEpub () {
return $this->getUpdatedFilename () . ".epub";
}
public function getUpdatedFilenameKepub () {
return $this->getUpdatedFilename () . ".kepub.epub";
}
public function getDataLink ($rel, $title = NULL) {
return self::getLink ($this->book, $this->extension, $this->getMimeType (), $rel, $this->getFilename (), $this->id, $title);
}