All notable changes to php-ebook
will be documented in this file.
Fix Mobi file error "Prevent counting on null", with #100 by @SergioMendolia
BREAKING CHANGES
Latest version of kiwilan/php-audio
v4.. is required to use audiobooks.
Update dependencies: kiwilan/php-xml-reader
, pestphp/pest
and kiwilan/php-audio
.
BREAKING CHANGES
Latest version of kiwilan/php-audio
v4.. is required to use audiobooks.
Update dependencies: kiwilan/php-xml-reader
, pestphp/pest
and kiwilan/php-audio
.
Add duration_human_readable
for getExtras()
method for audiobooks.
Works with kiwilan/php-audio
v3.0.08.
Fix missing genres crash for audiobooks.
Fix CbamTemplate::class
pages count, if PageCount
is not set, then use getArchive()->getCount()
from Ebook::class
.
Hotfix PR #91 for issue #71 by @basitcodeenv, thanks!
Fix issue #71 with PR #89 by @basitcodeenv, thanks!
MetaTitle::class
with getSeriesSlug()
, addExtension
parameter is now as false
by default, to avoid split series between .cbz
and .cbr
or .m4b
and .mp3
files.
Fix version
Now CBAM (ComicInfo.xml) with a Series
but without Number
will have default Number
as 0
.
Refactor MetaTitle::class
getSeriesSlugSimple()
,getSlugSimple()
are deprecatedgetSlug()
have now multiple parameters to customize the slug:removeDeterminers
,addSeries
,addVolume
,addAuthor
,addYear
,addExtension
,addLanguage
(all aretrue
by default)getSeriesSlug()
have now multiple parameters to customize the slug:removeDeterminers
,addAuthor
,addExtension
,addLanguage
(removeDeterminers
,addExtension
,addLanguage
aretrue
by default,addAuthor
isfalse
by default)
BREAKING CHANGES
- Remove
getDescriptionHtml()
method fromEbook
class. - Remove
limit
parameter fromgetDescription()
method inEbook
class. getDescription()
method inEbook
class now returns raw description without any formatting.
FEATURES
To access to advanced book description, you can use getDescriptionAdvanced()
method with BookDescription
class.
getDescription()
method now returns raw description without any formatting.toHtml()
method formats the description to HTML.toString()
method formats the description to plain text.toStringMultiline()
method formats the description to plain text with new lines.
All methods have limit
parameter to limit the length of the description.
BUGFIXES
- Improve audiobook parsing with safe array extraction.
MISC
- Remove many utilities method from
EbookModule
class, nowBookDescription
class is responsible for parsing book description. limitLength()
method is now intoEbookUtils
class.
AudiobookModule::class
: fix parsing of audiobook with volume 0.
MetaTitle::class
: clear docs
EbookUtils::class
fix parseStringWithSeperator()
method.
MetaTitle::class
: now native slugifier is fixed, float volume works now, volume use000
padding.- Allow authors with
,
,;
and&
in the name for.opf
,.pdf
,.mobi
and audiobooks.
MetaTitle::class
:fromData()
methodvolume
parameter is nowstring|int|float|null
instead ofstring|int|null
.
New feature with volume numbers as floats.
Ebook::class
: nowgetVolume()
returnsint|float|null
instead ofint|null
ComicMeta::class
: new propertynumber
(int|float|null
),volume
andstoryArcNumber
are nowint|float|null
instead ofint|null
For audiobooks, specifications are now based on audiobookshelf specifications.
**ID3 Tag (case-insensitive) ** | eBook |
---|---|
artist / album-artist |
Authors* |
album / title |
Title |
subtitle |
Extra property subtitle |
publisher |
Publisher |
year |
Publish Year |
composer |
Extra property narrators |
description |
Description |
genre |
Tags** |
series / mvnm |
Series |
series-part / mvin |
Volume |
language / lang |
Language |
isbn |
Identifiers isbn |
asin / audible_asin |
Identifiers asin |
Overdrive MediaMarkers | Extra property chapters |
-
- Authors naming as well as multiple authors separated by
,
,;
,&
orand
.
- Authors naming as well as multiple authors separated by
-
** Tags can include multiple tags separated by
/
,//
, or;
. e.g. "Science Fiction/Fiction/Fantasy"
OpfItem::class
methodgetMeta()
is now deprecated. UsegetMetaItems()
instead.OpfItem::class
methodgetMetaItems()
will now return an array ofBookMeta::class
objects.OpfItem::class
methodgetMetaItem(string $key)
will now returnBookMeta::class
object or null.
MetaTitle::class
: add fromData()
static method to generate a MetaTitle
object from a raw data and rename make()
to fromEbook()
.
- Audiobook: add
language
,tags
will be splitted by;
or,
- MetaTitle: now
language
slug will be added just after series if series exists, and before author if not to help for sorting with series in different languages
Ebook
class: addgetCreatedAt()
method to get the file modified date, addgetSize()
method to get the file size andgetSizeHumanReadable()
method to get the file size in human readable formatAudiobookModule
: add all audio metadata togetExtras()
method, removecomment
fromgetDescription()
method (now available intogetExtras()
method)
- Remove year from
MetaTitle
getSeriesSlug()
to avoid duplicate series. - Move namespace
Tools
toModels
Refactor determiners for MetaTitle
.
Fix version.
In MetaTitle
, add series before title for getSlug()
.
In MetaTitle
, move year after author.
Deprecated some MetaTitle
methods getSlugSort()
, getSlugUnique()
, getSerieSlug()
, getSerieSlugSort()
, getSerieSlugUnique()
, getSlugSortWithSerie()
, getUniqueFilename()
. Now only getSlug()
, getSlugSimple()
, getSeriesSlug()
, getSeriesSlugSimple()
are available.
Slug have to be unique, so default slug take some metadata to be unique, like in this example:
An EPUB with title La pâle lumière des ténèbres
with main author Pierre Bottero
, series A comme Association
, volume 1
, language fr
and published in 1980
will have the slug pale-lumiere-des-tenebres-a-comme-association-01-1980-pierre-bottero-epub-fr
.
You can use getSlugSimple()
to have a simple slug, like pale-lumiere-des-tenebres
.
For series, you can use getSeriesSlug()
to have a slug with series name, like a-comme-association-1980-pierre-bottero-epub-fr
.
And getSeriesSlugSimple()
to have a simple slug with series name, like a-comme-association
.
Drop kiwilan/php-audio
dependency.
Audiobooks are cool, but I suppose many users don't need it. So I think it's better to drop kiwilan/php-audio
dependency, you have to install kiwilan/php-audio
manually.
If you scan audiobooks without kiwilan/php-audio
installed, you will get an error message.
Update dependencies (drop symfony/process dependency)
-
EbookMetadata
is nowEbookParser
for consistency- Method
getMetadata
is nowgetParser
- Method
hasMetadata
is nowhasParser
- Method
-
BookIdentifier
can use nowautoDetect
to detect identifierscheme
fromvalue
, you can disable this feature by passingfalse
as third argument
- All
Metadata
internal classes have been renamed toModule
- Some internal parser classes, have been moved into
Parser
namespace - All
getContent()
methods have been renamed togetContents()
(old methods are deprecated)
- MOBI and derivatives support (
.azw
,.azw3
,.kf8
,.kfx
,.mobi
,.prc
) with cover - FB2 support (
.fb2
) with cover and series - Improve BookIdentifier scheme detection
- Fixing EPUB volume
0
issue - Add more tests with samples
- Update dependencies
- Improve documentation
- Better handle of PDF, parser works even if metadata are not present
- Add more tests on PDF, update
kiwilan/php-archive
with patch for PDF - Thanks to @SergioMendolia for PR #48
- Add more tests on PDF, update
- avoids crashing when trying to read metadata while archive is null, by @SergioMendolia in #45
- Add some improvements for
description
parsing (remove extra spaces, remove newlines, etc.) - Add
EbookCreator::class
withcreate()
method intoEbook::class
that allows to create ebook fromEbook
instance- Some methods allow to set content to ebook:
addFromString()
,addFile()
,addDirectory()
- Some methods allow to set content to ebook:
- add
descriptionHtml()
method toEbook::class
, which can contains description with html tags if it is available, html is sanitized, original description is still available viadescription()
method with plain text - add
getBasename()
method toEbook::class
, which returns basename of ebook file,getFilename()
now return real filename of ebook file - add
isValid(string $path)
static method toEbook::class
, which checks if ebook file is valid, thanks to @SergioMendolia: #38 - fix
<dc:creator>
empty tag inopf
file, thanks to @SergioMendolia: #39 - Bugfixes
- fix
OpfMetadata
dcRights()
parse array to string
- add
Epub
propertyisBadFile
to check if the file is corrupted, eBook file will be read but not parsed if it is corrupted, it's possible to know if file is valid withisBadFile()
method or withhasMetadata()
method - fix some problems with OPF parsing to be more flexible
- add
opf:metadata
support for OPF files
- All simple getters have now
get
prefix. For example,getTitle()
instead oftitle()
,getPublisher()
instead ofpublisher()
, etc. It concerns all simple getters ofEpubMetadata
,EpubChapter
,EpubHtml
,NcxMetadata
,EpubContainer
,OpfMetadata
,Ebook
,BookIdentifier
,EbookCover
,EbookMetadata
,AudiobookMetadata
,BookAuthor
,CbaMetadata
,CbamMetadata
,MetaTitle
classes.
Why? All these classes have some methods like setters or actions. To be consistent and clear, all simple getters have now
get
prefix.
BookContributor
andBookIdentifier
can be more flexible withmixed
types
- EbookCover
content
method fix
- bump
kiwilan/php-archive
1.5.12
- bump
kiwilan/php-archive
to1.5.11
- bumpp
kiwilan/php-archive
chore
:kiwilan/php-xml-reader
to0.2.31
- BREAKING CHANGE:
extrasExtract()
is nowextra()
chore
:kiwilan/php-xml-reader
to 0.2.30
chore
: updatekiwilan/php-xml-reader
to0.2.22
MetaTitle
improveuniqueFilename
MetaTitle
fixuniqueFilename()
with series
- limit length fix bug
- improve
toArray()
forEpubMetadata
- add
limit
option tocopyright
anddescription
- Fix some
kiwilan/php-xml-reader
parsing error
- Update dependency
kiwilan/php-xml-reader
OpfMetadata::class
fix only one tag
- Use
kiwilan/php-xml-reader
instead ofXmlReader::class
BREAKING CHANGE
BookIdentifier::class
=>content
is nowvalue
andtype
is nowscheme
FEATURE
- Add
EPUB
chapters support
- Add partial
.mobi
support - For
EbookMetadata::class
all methods withhas
prefix useis
prefix now - Add
uniqueFilename
method toMetaTitle::class
- improve documentation
- add tests
MetaTitle
adduniqueFilename
OpfMetadata
fix cover parser to keep only pictures
EpubMetadata::class
fixparseFiles
method
- add
extrasExtract
method inEbook::class
BREAKING CHANGES
book
property has been removed, all book metadata are now on root ofEbook::class
metadata
property is nowEbookMetadata::class
withmodule
property andepub
,cba
,pdf
,audiobook
properties to parse metadata- count for pages or words is now available if
wordsCount
orpagesCount
is called
Features
- improve performances
- add audiobooks
- BookIdentifier
content
is now nullable
- BookMeta
name
andcontent
are now nullable
- Add no metadata case with
title
as filename forepub
BookEntity
propertywords
is nowwordsCount
EpubOpf
is nowOpfMetadata
,CbaFormat
is nowCbaMetadata
- add properties to
OpfMetadata
withmetadata
,manifest
,spine
,guide
MetaTitle
fix accent characters- add tests
- MetaTitle
slugSortWithSerie
fix
- improve documentation
- make
slugSortWithSerie
always generated (if title)
- update
titleMeta
tometaTitle
- add
titleMeta()
toBookEntity
with extra infos with title slug and series slug - move
ComicMeta
toKiwilan\Ebook\Entity\ComicMeta
- add
filename
toEbook
- remove
path
fromBookEntity
(it's inEbook
) Book
manga
is defaultUNKNOWN
- add methods
toArray
,toJson
and__toString
toEbook
,BookEntity
,OpfMetadata
,CbaMetadata
- add
words
property
- Move
BookEntity
cover
toEbook
- Update
kiwilan/php-archive
init