({$item['alternate_title']})" : ""; ?> +
There's nothing here!
+ $items): ?>= $name ?>
({$item['alternate_title']})" : ""; ?> +
diff --git a/app/base/BaseController.php b/app/base/BaseController.php
index 28adef0b..38dca981 100644
--- a/app/base/BaseController.php
+++ b/app/base/BaseController.php
@@ -54,6 +54,7 @@ class BaseController {
public function __construct(Config &$config, Array $web)
{
$this->config = $config;
+ $this->base_data['config'] = $config;
list($request, $response) = $web;
$this->request = $request;
@@ -70,6 +71,24 @@ class BaseController {
$this->output();
}
+ /**
+ * Get a class member
+ *
+ * @param string $key
+ * @return object
+ */
+ public function __get($key)
+ {
+ $allowed = ['request', 'response', 'config'];
+
+ if (in_array($key, $allowed))
+ {
+ return $this->$key;
+ }
+
+ return NULL;
+ }
+
/**
* Get the string output of a partial template
*
@@ -95,7 +114,7 @@ class BaseController {
if ( ! is_file($template_path))
{
- throw new Exception("Invalid template : {$path}");
+ throw new InvalidArgumentException("Invalid template : {$path}");
}
ob_start();
@@ -152,16 +171,9 @@ class BaseController {
*/
public function redirect($url, $code, $type="anime")
{
- $url = full_url($url, $type);
+ $url = $this->config->full_url($url, $type);
- $codes = [
- 301 => 'Moved Permanently',
- 302 => 'Found',
- 303 => 'See Other'
- ];
-
- header("HTTP/1.1 {$code} {$codes[$code]}");
- header("Location: {$url}");
+ $this->response->redirect->to($url, $code);
}
/**
@@ -189,7 +201,7 @@ class BaseController {
public function logout()
{
session_destroy();
- $this->response->redirect->seeOther(full_url(''));
+ $this->response->redirect->seeOther($this->config->full_url(''));
}
/**
@@ -228,7 +240,7 @@ class BaseController {
)
)
{
- $this->response->redirect->afterPost(full_url('', $this->base_data['url_type']));
+ $this->response->redirect->afterPost($this->config->full_url('', $this->base_data['url_type']));
return;
}
diff --git a/app/base/BaseModel.php b/app/base/BaseModel.php
index a28e9c3c..5de557ce 100644
--- a/app/base/BaseModel.php
+++ b/app/base/BaseModel.php
@@ -73,7 +73,7 @@ class BaseModel {
}
else
{
- throw new Exception("Couldn't cache images because they couldn't be downloaded.");
+ throw new DomainException("Couldn't cache images because they couldn't be downloaded.");
}
// Resize the image
diff --git a/app/base/Config.php b/app/base/Config.php
index 93de5b35..c0e508a1 100644
--- a/app/base/Config.php
+++ b/app/base/Config.php
@@ -52,5 +52,77 @@ class Config {
return NULL;
}
+
+ /**
+ * Get the base url for css/js/images
+ *
+ * @return string
+ */
+ function asset_url(/*...*/)
+ {
+ $args = func_get_args();
+ $base_url = rtrim($this->__get('asset_path'), '/');
+
+ array_unshift($args, $base_url);
+
+ return implode("/", $args);
+ }
+
+ /**
+ * Get the base url from the config
+ *
+ * @param string $type - (optional) The controller
+ * @return string
+ */
+ function base_url($type="anime")
+ {
+ $config_path = trim($this->__get("{$type}_path"), "/");
+ $config_host = $this->__get("{$type}_host");
+
+ // Set the appropriate HTTP host
+ $host = ($config_host !== '') ? $config_host : $_SERVER['HTTP_HOST'];
+ $path = ($config_path !== '') ? $config_path : "";
+
+ return implode("/", ['/', $host, $path]);
+ }
+
+ /**
+ * Generate full url path from the route path based on config
+ *
+ * @param string $path - (optional) The route path
+ * @param string $type - (optional) The controller (anime or manga), defaults to anime
+ * @return string
+ */
+ function full_url($path="", $type="anime")
+ {
+ $config_path = trim($this->__get("{$type}_path"), "/");
+ $config_host = $this->__get("{$type}_host");
+ $config_default_route = $this->__get("default_{$type}_path");
+
+ // Remove beginning/trailing slashes
+ $config_path = trim($config_path, '/');
+ $path = trim($path, '/');
+
+ // Remove any optional parameters from the route
+ $path = preg_replace('`{/.*?}`i', '', $path);
+
+ // Set the appropriate HTTP host
+ $host = ($config_host !== '') ? $config_host : $_SERVER['HTTP_HOST'];
+
+ // Set the default view
+ if ($path === '')
+ {
+ $path .= trim($config_default_route, '/');
+ if ($this->__get('default_to_list_view')) $path .= '/list';
+ }
+
+ // Set an leading folder
+ if ($config_path !== '')
+ {
+ $path = "{$config_path}/{$path}";
+ }
+
+ return "//{$host}/{$path}";
+ }
}
// End of config.php
\ No newline at end of file
diff --git a/app/base/Router.php b/app/base/Router.php
index 829b2c5d..beeb9804 100644
--- a/app/base/Router.php
+++ b/app/base/Router.php
@@ -64,7 +64,7 @@ class Router {
{
global $defaultHandler;
- $raw_route = $this->request->server->get('REQUEST_URI');
+ $raw_route = parse_url($this->request->server->get('REQUEST_URI'), \PHP_URL_PATH);
$route_path = str_replace([$this->config->anime_path, $this->config->manga_path], '', $raw_route);
$route_path = "/" . trim($route_path, '/');
@@ -108,14 +108,14 @@ class Router {
$failure = $this->router->getFailedRoute();
$defaultHandler->addDataTable('failed_route', (array)$failure);
- $controller_name = '\\AnimeClient\\BaseController';
+ /*$controller_name = '\\AnimeClient\\BaseController';
$action_method = 'outputHTML';
$params = [
'template' => '404',
'data' => [
'title' => 'Page Not Found'
]
- ];
+ ];*/
}
else
{
@@ -148,7 +148,7 @@ class Router {
*/
public function get_route_type()
{
- $route_type = "";
+ $route_type = $this->config->default_list;
$host = $this->request->server->get("HTTP_HOST");
$request_uri = $this->request->server->get('REQUEST_URI');
diff --git a/app/base/functions.php b/app/base/functions.php
index ee84069e..fa9d81ce 100644
--- a/app/base/functions.php
+++ b/app/base/functions.php
@@ -38,87 +38,6 @@ function is_not_selected($a, $b)
return ($a !== $b) ? 'selected' : '';
}
-/**
- * Get the base url for css/js/images
- *
- * @return string
- */
-function asset_url(/*...*/)
-{
- global $config;
-
- $args = func_get_args();
- $base_url = rtrim($config->asset_path, '/');
-
- array_unshift($args, $base_url);
-
- return implode("/", $args);
-}
-
-/**
- * Get the base url from the config
- *
- * @param string $type - (optional) The controller
- # @param object $config - (optional) Config
- * @return string
- */
-function base_url($type="anime", $config=NULL)
-{
- if (is_null($config)) global $config;
-
-
- $config_path = trim($config->{"{$type}_path"}, "/");
- $config_host = $config->{"{$type}_host"};
-
- // Set the appropriate HTTP host
- $host = ($config_host !== '') ? $config_host : $_SERVER['HTTP_HOST'];
- $path = ($config_path !== '') ? $config_path : "";
-
- return implode("/", ['/', $host, $path]);
-}
-
-/**
- * Generate full url path from the route path based on config
- *
- * @param string $path - (optional) The route path
- * @param string $type - (optional) The controller (anime or manga), defaults to anime
- # @param object $config - (optional) Config
- * @return string
- */
-function full_url($path="", $type="anime", $config=NULL)
-{
- if (is_null($config)) global $config;
-
- $config_path = trim($config->{"{$type}_path"}, "/");
- $config_host = $config->{"{$type}_host"};
- $config_default_route = $config->{"default_{$type}_path"};
-
- // Remove beginning/trailing slashes
- $config_path = trim($config_path, '/');
- $path = trim($path, '/');
-
- // Remove any optional parameters from the route
- $path = preg_replace('`{/.*?}`i', '', $path);
-
- // Set the appropriate HTTP host
- $host = ($config_host !== '') ? $config_host : $_SERVER['HTTP_HOST'];
-
- // Set the default view
- if ($path === '')
- {
- $path .= trim($config_default_route, '/');
- if ($config->default_to_list_view) $path .= '/list';
- }
-
- // Set an leading folder
- if ($config_path !== '')
- {
- $path = "{$config_path}/{$path}";
- }
-
- return "//{$host}/{$path}";
-}
-
/**
* Get the last segment of the current url
*
@@ -131,4 +50,19 @@ function last_segment()
return end($segments);
}
+/**
+ * Determine whether to show the sub-menu
+ *
+ * @return bool
+ */
+function is_view_page()
+{
+ $blacklist = ['edit', 'add', 'update', 'login', 'logout'];
+ $page_segments = explode("/", $_SERVER['REQUEST_URI']);
+
+ $intersect = array_intersect($page_segments, $blacklist);
+
+ return empty($intersect);
+}
+
// End of functions.php
\ No newline at end of file
diff --git a/app/config/config.php b/app/config/config.php
index dd505833..424e0534 100644
--- a/app/config/config.php
+++ b/app/config/config.php
@@ -32,6 +32,9 @@ $config = [
'anime_path' => '',
'manga_path' => '',
+ // Which list should be the default?
+ 'default_list' => 'anime', // anime or manga
+
// Default pages for anime/manga
'default_anime_path' => '/watching',
'default_manga_path' => '/all',
diff --git a/app/config/minify_js_groups.php b/app/config/minify_js_groups.php
index 3df263a4..e747e40d 100644
--- a/app/config/minify_js_groups.php
+++ b/app/config/minify_js_groups.php
@@ -34,6 +34,12 @@ return [
'show_message.js',
'anime_edit.js',
'manga_edit.js'
+ ],
+ 'collection' => [
+ 'lib/jquery.min.js',
+ 'lib/jquery.throttle-debounce.js',
+ 'lib/jsrender.js',
+ 'collection.js'
]
];
diff --git a/app/config/routes.php b/app/config/routes.php
index 3dac08b8..02c4241f 100644
--- a/app/config/routes.php
+++ b/app/config/routes.php
@@ -33,6 +33,10 @@ return [
'code' => '301'
]
],
+ 'search' => [
+ 'path' => '/search',
+ 'action' => ['search'],
+ ],
'all' => [
'path' => '/all{/view}',
'action' => ['anime_list'],
@@ -99,14 +103,36 @@ return [
'view' => '[a-z_]+'
]
],
+ 'collection_add_form' => [
+ 'path' => '/collection/add',
+ 'action' => ['collection_form'],
+ 'params' => [],
+ ],
+ 'collection_edit_form' => [
+ 'path' => '/collection/edit/{id}',
+ 'action' => ['collection_form'],
+ 'tokens' => [
+ 'id' => '[0-9]+'
+ ]
+ ],
+ 'collection_add' => [
+ 'path' => '/collection/add',
+ 'action' => ['collection_add'],
+ 'verb' => 'post'
+ ],
+ 'collection_edit' => [
+ 'path' => '/collection/edit',
+ 'action' => ['collection_edit'],
+ 'verb' => 'post'
+ ],
'collection' => [
- 'path' => '/collection{/view}',
+ 'path' => '/collection/view{/view}',
'action' => ['collection'],
'params' => [],
'tokens' => [
'view' => '[a-z_]+'
]
- ]
+ ],
],
'manga' => [
'index' => [
diff --git a/app/controllers/AnimeController.php b/app/controllers/AnimeController.php
index 81d24fee..7e8056a3 100644
--- a/app/controllers/AnimeController.php
+++ b/app/controllers/AnimeController.php
@@ -38,7 +38,7 @@ class AnimeController extends BaseController {
'On Hold' => '/on_hold{/view}',
'Dropped' => '/dropped{/view}',
'Completed' => '/completed{/view}',
- 'Collection' => '/collection{/view}',
+ 'Collection' => '/collection/view{/view}',
'All' => '/all{/view}'
];
@@ -61,9 +61,21 @@ class AnimeController extends BaseController {
'url_type' => 'anime',
'other_type' => 'manga',
'nav_routes' => $this->nav_routes,
+ 'config' => $this->config,
];
}
+ /**
+ * Search for anime
+ *
+ * @return void
+ */
+ public function search()
+ {
+ $query = $this->request->query->get('query');
+ $this->outputJSON($this->model->search($query));
+ }
+
/**
* Show a portion, or all of the anime list
*
@@ -104,10 +116,66 @@ class AnimeController extends BaseController {
$this->outputHTML('anime/' . $view_map[$view], [
'title' => WHOSE . " Anime Collection",
- 'sections' => $data
+ 'sections' => $data,
+ 'genres' => $this->collection_model->get_genre_list()
]);
}
+ /**
+ * Show the anime collection add/edit form
+ *
+ * @param int $id
+ * @return void
+ */
+ public function collection_form($id=NULL)
+ {
+ $action = (is_null($id)) ? "Add" : "Edit";
+
+ $this->outputHTML('anime/collection_' . strtolower($action), [
+ 'action' => $action,
+ 'action_url' => $this->config->full_url("collection/" . strtolower($action)),
+ 'title' => WHOSE . " Anime Collection · {$action}",
+ 'media_items' => $this->collection_model->get_media_type_list(),
+ 'item' => ($action === "Edit") ? $this->collection_model->get($id) : []
+ ]);
+ }
+
+ /**
+ * Update a collection item
+ *
+ * @return void
+ */
+ public function collection_edit()
+ {
+ $data = $this->request->post->get();
+ if ( ! array_key_exists('hummingbird_id', $data))
+ {
+ $this->redirect("collection/view", 303, "anime");
+ }
+
+ $this->collection_model->update($data);
+
+ $this->redirect("collection/view", 303, "anime");
+ }
+
+ /**
+ * Add a collection item
+ *
+ * @return void
+ */
+ public function collection_add()
+ {
+ $data = $this->request->post->get();
+ if ( ! array_key_exists('id', $data))
+ {
+ $this->redirect("collection/view", 303, "anime");
+ }
+
+ $this->collection_model->add($data);
+
+ $this->redirect("collection/view", 303, "anime");
+ }
+
/**
* Update an anime item
*
@@ -115,7 +183,7 @@ class AnimeController extends BaseController {
*/
public function update()
{
- print_r($this->model->update($this->request->post->get()));
+ $this->outputJSON($this->model->update($this->request->post->get()));
}
}
// End of AnimeController.php
\ No newline at end of file
diff --git a/app/controllers/MangaController.php b/app/controllers/MangaController.php
index 846a6eb5..7f65dfe6 100644
--- a/app/controllers/MangaController.php
+++ b/app/controllers/MangaController.php
@@ -43,6 +43,7 @@ class MangaController extends BaseController {
parent::__construct($config, $web);
$this->model = new MangaModel($config);
$this->base_data = [
+ 'config' => $this->config,
'url_type' => 'manga',
'other_type' => 'anime',
'nav_routes' => $this->nav_routes
diff --git a/app/models/AnimeCollectionModel.php b/app/models/AnimeCollectionModel.php
index e350a835..9ec45571 100644
--- a/app/models/AnimeCollectionModel.php
+++ b/app/models/AnimeCollectionModel.php
@@ -42,6 +42,49 @@ class AnimeCollectionModel extends BaseDBModel {
$this->json_import();
}
+ /**
+ * Get genres for anime collection items
+ *
+ * @param array $filter
+ * @return array
+ */
+ public function get_genre_list($filter=[])
+ {
+ $this->db->select('hummingbird_id, genre')
+ ->from('genre_anime_set_link gl')
+ ->join('genres g', 'g.id=gl.genre_id', 'left');
+
+
+ if ( ! empty($filter)) $this->db->where_in('hummingbird_id', $filter);
+
+ $query = $this->db->order_by('hummingbird_id')
+ ->order_by('genre')
+ ->get();
+
+ $output = [];
+
+ foreach($query->fetchAll(\PDO::FETCH_ASSOC) as $row)
+ {
+ $id = $row['hummingbird_id'];
+ $genre = $row['genre'];
+
+ // Empty genre names aren't useful
+ if (empty($genre)) continue;
+
+
+ if (array_key_exists($id, $output))
+ {
+ array_push($output[$id], $genre);
+ }
+ else
+ {
+ $output[$id] = [$genre];
+ }
+ }
+
+ return $output;
+ }
+
/**
* Get collection from the database, and organize by media type
*
@@ -68,6 +111,42 @@ class AnimeCollectionModel extends BaseDBModel {
return $collection;
}
+ /**
+ * Get list of media types
+ *
+ * @return array
+ */
+ public function get_media_type_list()
+ {
+ $output = array();
+
+ $query = $this->db->select('id, type')
+ ->from('media')
+ ->get();
+
+ foreach($query->fetchAll(\PDO::FETCH_ASSOC) as $row)
+ {
+ $output[$row['id']] = $row['type'];
+ }
+
+ return $output;
+ }
+
+ /**
+ * Get item from collection for editing
+ *
+ * @param int $id
+ * @return array
+ */
+ public function get_collection_entry($id)
+ {
+ $query = $this->db->from('anime_set')
+ ->where('hummingbird_id', (int) $id)
+ ->get();
+
+ return $query->fetch(\PDO::FETCH_ASSOC);
+ }
+
/**
* Get full collection from the database
*
@@ -87,6 +166,67 @@ class AnimeCollectionModel extends BaseDBModel {
return $query->fetchAll(\PDO::FETCH_ASSOC);
}
+ /**
+ * Add an item to the anime collection
+ *
+ * @param array $data
+ * @return void
+ */
+ public function add($data)
+ {
+ $anime = (object) $this->anime_model->get_anime($data['id']);
+
+ $this->db->set([
+ 'hummingbird_id' => $data['id'],
+ 'slug' => $anime->slug,
+ 'title' => $anime->title,
+ 'alternate_title' => $anime->alternate_title,
+ 'show_type' => $anime->show_type,
+ 'age_rating' => $anime->age_rating,
+ 'cover_image' => basename($this->get_cached_image($anime->cover_image, $anime->slug, 'anime')),
+ 'episode_count' => $anime->episode_count,
+ 'episode_length' => $anime->episode_length,
+ 'media_id' => $data['media_id'],
+ 'notes' => $data['notes']
+ ])->insert('anime_set');
+
+ $this->update_genre($data['id']);
+ }
+
+ /**
+ * Update a collection item
+ *
+ * @param array $data
+ * @return void
+ */
+ public function update($data)
+ {
+ // If there's no id to update, don't update
+ if ( ! array_key_exists('hummingbird_id', $data)) return;
+
+ $id = $data['hummingbird_id'];
+ unset($data['hummingbird_id']);
+
+ $this->db->set($data)
+ ->where('hummingbird_id', $id)
+ ->update('anime_set');
+ }
+
+ /**
+ * Get the details of a collection item
+ *
+ * @param int $hummingbird_id
+ * @return array
+ */
+ public function get($hummingbird_id)
+ {
+ $query = $this->db->from('anime_set')
+ ->where('hummingbird_id', $hummingbird_id)
+ ->get();
+
+ return $query->fetch(\PDO::FETCH_ASSOC);
+ }
+
/**
* Import anime into collection from a json file
*
@@ -108,7 +248,7 @@ class AnimeCollectionModel extends BaseDBModel {
'alternate_title' => $item->alternate_title,
'show_type' => $item->show_type,
'age_rating' => $item->age_rating,
- 'cover_image' => $this->get_cached_image($item->cover_image, $item->slug, 'anime'),
+ 'cover_image' => basename($this->get_cached_image($item->cover_image, $item->slug, 'anime')),
'episode_count' => $item->episode_count,
'episode_length' => $item->episode_length
])->insert('anime_set');
@@ -122,22 +262,67 @@ class AnimeCollectionModel extends BaseDBModel {
}
/**
- * Update genre information
+ * Update genre information for selected anime
*
* @return void
*/
- private function update_genres()
+ private function update_genre($anime_id)
+ {
+ $genre_info = $this->get_genre_data();
+ extract($genre_info);
+
+ // Get api information
+ $anime = $this->anime_model->get_anime($anime_id);
+
+ foreach($anime['genres'] as $genre)
+ {
+ // Add genres that don't currently exist
+ if ( ! in_array($genre['name'], $genres))
+ {
+ $this->db->set('genre', $genre['name'])
+ ->insert('genres');
+
+ $genres[] = $genre['name'];
+ }
+
+ // Update link table
+ // Get id of genre to put in link table
+ $flipped_genres = array_flip($genres);
+
+ $insert_array = [
+ 'hummingbird_id' => $anime['id'],
+ 'genre_id' => $flipped_genres[$genre['name']]
+ ];
+
+ if (array_key_exists($anime['id'], $links))
+ {
+ if ( ! in_array($flipped_genres[$genre['name']], $links[$anime['id']]))
+ {
+ $this->db->set($insert_array)->insert('genre_anime_set_link');
+ }
+ }
+ else
+ {
+ $this->db->set($insert_array)->insert('genre_anime_set_link');
+ }
+ }
+ }
+
+ /**
+ * Get list of existing genres
+ *
+ * @return array
+ */
+ private function get_genre_data()
{
$genres = [];
- $flipped_genres = [];
-
$links = [];
// Get existing genres
$query = $this->db->select('id, genre')
->from('genres')
->get();
- foreach($query->fetchAll(PDO::FETCH_ASSOC) as $genre)
+ foreach($query->fetchAll(\PDO::FETCH_ASSOC) as $genre)
{
$genres[$genre['id']] = $genre['genre'];
}
@@ -146,7 +331,7 @@ class AnimeCollectionModel extends BaseDBModel {
$query = $this->db->select('hummingbird_id, genre_id')
->from('genre_anime_set_link')
->get();
- foreach($query->fetchAll(PDO::FETCH_ASSOC) as $link)
+ foreach($query->fetchAll(\PDO::FETCH_ASSOC) as $link)
{
if (array_key_exists($link['hummingbird_id'], $links))
{
@@ -158,48 +343,25 @@ class AnimeCollectionModel extends BaseDBModel {
}
}
+ return [
+ 'genres' => $genres,
+ 'links' => $links
+ ];
+ }
+
+ /**
+ * Update genre information for the entire collection
+ *
+ * @return void
+ */
+ private function update_genres()
+ {
// Get the anime collection
$collection = $this->_get_collection();
foreach($collection as $anime)
{
// Get api information
- $api = $this->anime_model->get_anime($anime['hummingbird_id']);
-
-
- foreach($api['genres'] as $genre)
- {
- // Add genres that don't currently exist
- if ( ! in_array($genre['name'], $genres))
- {
- $this->db->set('genre', $genre['name'])
- ->insert('genres');
-
- $genres[] = $genre['name'];
- }
-
-
- // Update link table
-
- // Get id of genre to put in link table
- $flipped_genres = array_flip($genres);
-
- $insert_array = [
- 'hummingbird_id' => $anime['hummingbird_id'],
- 'genre_id' => $flipped_genres[$genre['name']]
- ];
-
- if (array_key_exists($anime['hummingbird_id'], $links))
- {
- if ( ! in_array($flipped_genres[$genre['name']], $links[$anime['hummingbird_id']]))
- {
- $this->db->set($insert_array)->insert('genre_anime_set_link');
- }
- }
- else
- {
- $this->db->set($insert_array)->insert('genre_anime_set_link');
- }
- }
+ $this->update_genre($anime['hummingbird_id']);
}
}
}
diff --git a/app/models/AnimeModel.php b/app/models/AnimeModel.php
index a4bd5be3..e24a22c0 100644
--- a/app/models/AnimeModel.php
+++ b/app/models/AnimeModel.php
@@ -157,7 +157,7 @@ class AnimeModel extends BaseApiModel {
if ($response->getStatusCode() != 200)
{
- throw new Exception($response->getEffectiveUrl());
+ throw new RuntimeException($response->getEffectiveUrl());
}
return $response->json();
@@ -192,7 +192,7 @@ class AnimeModel extends BaseApiModel {
{
if ( ! file_exists($cache_file))
{
- throw new Exception($response->getEffectiveUrl());
+ throw new DomainException($response->getEffectiveUrl());
}
else
{
diff --git a/app/models/MangaModel.php b/app/models/MangaModel.php
index ebef7243..b78da616 100644
--- a/app/models/MangaModel.php
+++ b/app/models/MangaModel.php
@@ -101,7 +101,7 @@ class MangaModel extends BaseApiModel {
{
if ( ! file_exists($cache_file))
{
- throw new Exception($response->getEffectiveUrl());
+ throw new DomainException($response->getEffectiveUrl());
}
else
{
@@ -124,7 +124,7 @@ class MangaModel extends BaseApiModel {
}
// Bail out early if there isn't any manga data
- if (empty($raw_data)) return [];
+ if ( ! array_key_exists('manga', $raw_data)) return [];
$data = [
'Reading' => [],
@@ -174,8 +174,6 @@ class MangaModel extends BaseApiModel {
}
}
- //file_put_contents(_dir($this->config->data_cache_path, "manga-processed.json"), json_encode($data, JSON_PRETTY_PRINT));
-
return (array_key_exists($status, $data)) ? $data[$status] : $data;
}
diff --git a/app/views/anime/collection.php b/app/views/anime/collection.php
index 28b40564..23b93e22 100644
--- a/app/views/anime/collection.php
+++ b/app/views/anime/collection.php
@@ -1,15 +1,22 @@
There's nothing here!
+
$items): ?>
= $name ?>
({$item['alternate_title']})" : ""; ?>
+
There's nothing here!
+
$items): ?>
= $name ?>
@@ -20,24 +29,28 @@
= $item['title'] ?>
+ = ( ! empty($item['alternate_title'])) ? " · " . $item['alternate_title'] : "" ?>
- Title
- Alternate Title
+ Alternate Title*/ ?>
Episode Count
Episode Length
Show Type
Age Rating
Notes
+
+
+
= $item['alternate_title'] ?>
+
+
+ = $item['title'] ?>
+
+
+ = $item['alternate_title'] ?> */ ?>
= $item['episode_count'] ?>
= $item['episode_length'] ?>
= $item['show_type'] ?>
= $item['age_rating'] ?>
= $item['notes'] ?>
+
+ [">Edit]
+
+
There's nothing here!
+
$items): ?>
= $name ?>
@@ -34,7 +37,8 @@
There's nothing here!
+
$items): ?>
= $name ?>
@@ -11,6 +14,7 @@
+
Type
Progress
Rated
+ Genres
@@ -27,10 +31,17 @@
= $item['anime']['show_type'] ?>
Episodes: = $item['episodes_watched'] ?> / = $item['anime']['episode_count'] ?>
= $item['anime']['age_rating'] ?>
+
+
+
+ = $genre['name'] ?>
+
+