Skip to content

Commit

Permalink
Merge pull request #60 from kiwilan/develop
Browse files Browse the repository at this point in the history
v2.3.11
  • Loading branch information
ewilan-riviere authored Jan 27, 2024
2 parents c3c78b6 + f433b85 commit 2a6cfc4
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,9 @@ use Kiwilan\Ebook\Ebook;
$ebook = Ebook::read('path/to/ebook.epub');
$metaTitle = $ebook->getMetaTitle(); // ?MetaTitle

$metaTitle->getSlug(); // string => slug title, like `pale-lumiere-des-tenebres-a-comme-association-01-1980-pierre-bottero-epub-fr`
$metaTitle->getSlug(); // string => slug title, like `pale-lumiere-des-tenebres-a-comme-association-01-pierre-bottero-1980-epub-fr`
$metaTitle->getSlugSimple(); // string => slug title simple, like `la-pale-lumiere-des-tenebres`
$metaTitle->getSeriesSlug(); // ?string => slug series title, like `a-comme-association-1980-pierre-bottero-epub-fr`
$metaTitle->getSeriesSlug(); // ?string => slug series title, like `a-comme-association-pierre-bottero-1980-epub-fr`
$metaTitle->getSeriesSlugSimple(); // ?string => slug series title simple, like `a-comme-association`
```

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "kiwilan/php-ebook",
"description": "PHP package to read metadata and extract covers from eBooks, comics and audiobooks.",
"version": "2.3.1",
"version": "2.3.11",
"keywords": [
"php",
"ebook",
Expand Down
8 changes: 4 additions & 4 deletions src/Tools/MetaTitle.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ private function parse(Ebook $ebook): static
$titleDeterminer,
$series,
$volume,
$year,
$author,
$year,
$extension,
$language,
]);
Expand All @@ -84,8 +84,8 @@ private function parse(Ebook $ebook): static

$this->seriesSlug = $this->generateSlug([
$seriesDeterminer,
$year,
$author,
$year,
$extension,
$language,
]);
Expand All @@ -95,7 +95,7 @@ private function parse(Ebook $ebook): static
}

/**
* Get slug of book title with addional metadata, like `pale-lumiere-des-tenebres-a-comme-association-01-pierre-bottero-epub-fr`.
* Get slug of book title with addional metadata, like `pale-lumiere-des-tenebres-a-comme-association-01-pierre-bottero-1980-epub-fr`.
*
* - Remove determiners, here `la`
* - Add serie title, here `A comme Association`
Expand All @@ -118,7 +118,7 @@ public function getSlugSimple(): string
}

/**
* Get slug of serie title, like `a-comme-association-pierre-bottero-epub-fr`.
* Get slug of serie title, like `a-comme-association-pierre-bottero-1980-epub-fr`.
*
* - Remove determiners
* - Add author name
Expand Down
4 changes: 2 additions & 2 deletions tests/MetaTitleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
$ebook->setAuthorMain(new BookAuthor('Pierre Bottero'));
$meta = MetaTitle::make($ebook);

expect($meta->getSlug())->toBe('pale-lumiere-des-tenebres-a-comme-association-01-1980-pierre-bottero-epub-fr');
expect($meta->getSlug())->toBe('pale-lumiere-des-tenebres-a-comme-association-01-pierre-bottero-1980-epub-fr');
expect($meta->getSlugSimple())->toBe('la-pale-lumiere-des-tenebres');

expect($meta->getSeriesSlug())->toBe('a-comme-association-1980-pierre-bottero-epub-fr');
expect($meta->getSeriesSlug())->toBe('a-comme-association-pierre-bottero-1980-epub-fr');
expect($meta->getSeriesSlugSimple())->toBe('a-comme-association');
});

0 comments on commit 2a6cfc4

Please sign in to comment.