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