summaryrefslogtreecommitdiff
path: root/app/Libraries
diff options
context:
space:
mode:
Diffstat (limited to 'app/Libraries')
-rw-r--r--app/Libraries/Helper.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/app/Libraries/Helper.php b/app/Libraries/Helper.php
index 7d89b2c..0cc21bf 100644
--- a/app/Libraries/Helper.php
+++ b/app/Libraries/Helper.php
@@ -114,6 +114,20 @@ class Helper {
->exists();
if ( $check ) {
$actually_watching[] = $anime_details["mal_id"];
+
+ /**
+ * Update watched episodes.
+ */
+ $check_watched_episodes = DB::table('is_watching')
+ ->where('mal_id', $anime_details["mal_id"])
+ ->where('user_id', $user->id)
+ ->get('episodes_watched')[0];
+ if ( $check_watched_episodes->episodes_watched != $anime_details["episodes_watched"] ) {
+ DB::update('UPDATE is_watching SET episodes_watched = ? WHERE mal_id = ? AND user_id = ?',
+ [ $anime_details["episodes_watched"], $anime_details["mal_id"], $user->id] );
+
+ }
+
continue;
}
$anime = Anime::where('mal_id', $anime_details["mal_id"])->get()->first();