Fix issue with cover not being hidden on last episode
This commit is contained in:
parent
d8c89c9deb
commit
26c6df74e4
@ -30,6 +30,7 @@ return function(array $config_array = []) {
|
||||
|
||||
$app_logger = new Logger('animeclient');
|
||||
$app_logger->pushHandler(new RotatingFileHandler(__DIR__ . '/logs/app.log', Logger::NOTICE));
|
||||
$app_logger->pushHandler(new BrowserConsoleHandler(Logger::INFO));
|
||||
$container->setLogger($app_logger, 'default');
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
|
@ -1,4 +1,6 @@
|
||||
template {
|
||||
template,
|
||||
[hidden="hidden"],
|
||||
.media[hidden] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
--edit-link-color: #12db18;
|
||||
}
|
||||
|
||||
template {display:none}
|
||||
template, [hidden="hidden"], .media[hidden] {display:none}
|
||||
|
||||
body {margin: 0.5em;}
|
||||
|
||||
|
@ -17,9 +17,6 @@ details {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/*input[type="number"] {
|
||||
width: auto; }*/
|
||||
|
||||
input[type="search"] {
|
||||
-webkit-appearance: textfield;
|
||||
}
|
||||
|
@ -15,8 +15,6 @@ audio:not([controls]) {
|
||||
details {
|
||||
display: block; }
|
||||
|
||||
/*input[type="number"] {
|
||||
width: auto; }*/
|
||||
input[type="search"] {
|
||||
-webkit-appearance: textfield; }
|
||||
input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration {
|
||||
|
@ -7,9 +7,7 @@
|
||||
|
||||
// Action to increment episode count
|
||||
_.on('body.anime.list', 'click', '.plus_one', function(e) {
|
||||
let this_sel = this;
|
||||
let parent_sel = _.closestParent(this, 'article');
|
||||
|
||||
let watched_count = parseInt(_.$('.completed_number', parent_sel)[0].textContent, 10);
|
||||
let total_count = parseInt(_.$('.total_number', parent_sel)[0].textContent, 10);
|
||||
let title = _.$('.name a', parent_sel)[0].textContent;
|
||||
@ -27,7 +25,7 @@
|
||||
}
|
||||
|
||||
// If you increment at the last episode, mark as completed
|
||||
if (( ! isNaN(watched_count)) && (watched_count + 1) === total_count) {
|
||||
if (( ! isNaN(watched_count)) && (watched_count + 1) == total_count) {
|
||||
delete data.increment_episodes;
|
||||
data.status = 'completed';
|
||||
}
|
||||
@ -39,7 +37,7 @@
|
||||
type: 'POST',
|
||||
mimeType: 'application/json',
|
||||
success: (res) => {
|
||||
if (res.status === 'completed') {
|
||||
if (data.status == 'completed') {
|
||||
_.hide(parent_sel);
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Hummingbird Anime Client
|
||||
*
|
||||
@ -16,7 +17,6 @@ namespace Aviat\AnimeClient\Controller;
|
||||
use Aviat\Ion\Di\ContainerInterface;
|
||||
use Aviat\AnimeClient\Controller as BaseController;
|
||||
use Aviat\AnimeClient\Hummingbird\Enum\AnimeWatchingStatus;
|
||||
use Aviat\AnimeClient\Model\Anime as AnimeModel;
|
||||
use Aviat\AnimeClient\Hummingbird\Transformer\AnimeListTransformer;
|
||||
|
||||
/**
|
||||
@ -122,7 +122,7 @@ class Anime extends BaseController {
|
||||
|
||||
foreach ($raw_status_list as $status_item)
|
||||
{
|
||||
$statuses[$status_item] = (string)$this->string($status_item)
|
||||
$statuses[$status_item] = (string) $this->string($status_item)
|
||||
->underscored()
|
||||
->humanize()
|
||||
->titleize();
|
||||
@ -180,7 +180,7 @@ class Anime extends BaseController {
|
||||
|
||||
foreach ($raw_status_list as $status_item)
|
||||
{
|
||||
$statuses[$status_item] = (string)$this->string($status_item)
|
||||
$statuses[$status_item] = (string) $this->string($status_item)
|
||||
->underscored()
|
||||
->humanize()
|
||||
->titleize();
|
||||
@ -216,12 +216,12 @@ class Anime extends BaseController {
|
||||
*/
|
||||
public function form_update()
|
||||
{
|
||||
$post_data = $this->request->getParsedBody();
|
||||
$data = $this->request->getParsedBody();
|
||||
|
||||
// Do some minor data manipulation for
|
||||
// large form-based updates
|
||||
$transformer = new AnimeListTransformer();
|
||||
$post_data = $transformer->untransform($post_data);
|
||||
$post_data = $transformer->untransform($data);
|
||||
|
||||
$full_result = $this->model->update($post_data);
|
||||
$result = $full_result['body'];
|
||||
@ -275,5 +275,7 @@ class Anime extends BaseController {
|
||||
'data' => $data,
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// End of AnimeController.php
|
@ -15,7 +15,6 @@ namespace Aviat\AnimeClient\Controller;
|
||||
use Aviat\Ion\Json;
|
||||
use Aviat\Ion\Di\ContainerInterface;
|
||||
use Aviat\AnimeClient\Controller;
|
||||
use Aviat\AnimeClient\Config;
|
||||
use Aviat\AnimeClient\Model\Manga as MangaModel;
|
||||
use Aviat\AnimeClient\Hummingbird\Enum\MangaReadingStatus;
|
||||
use Aviat\AnimeClient\Hummingbird\Transformer\MangaListTransformer;
|
||||
|
@ -15,8 +15,6 @@ namespace Aviat\AnimeClient\Model;
|
||||
|
||||
use Aviat\Ion\Json;
|
||||
use Aviat\Ion\Di\ContainerInterface;
|
||||
use Aviat\AnimeClient\AnimeClient;
|
||||
use Aviat\AnimeClient\Model\Anime as AnimeModel;
|
||||
|
||||
/**
|
||||
* Model for getting anime collection data
|
||||
|
Loading…
Reference in New Issue
Block a user