From 6c5aed67b7a338bf74e926782b6421a77c82cbb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Thu, 31 Jan 2013 14:30:04 +0100 Subject: [PATCH] Change the name of the epub downloaded to Author - Title. --- book.php | 2 +- data.php | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/book.php b/book.php index cc9896d..aaf5c71 100644 --- a/book.php +++ b/book.php @@ -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) { diff --git a/data.php b/data.php index 82ed41d..a6a56e4 100644 --- a/data.php +++ b/data.php @@ -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); }