diff --git a/dist/main.js b/dist/main.js index a4b7f00..1ed8569 100644 Binary files a/dist/main.js and b/dist/main.js differ diff --git a/dist/view.js b/dist/view.js index 1ee5761..638b667 100644 Binary files a/dist/view.js and b/dist/view.js differ diff --git a/php/modules/Album.php b/php/modules/Album.php index c8eb572..bd78837 100644 --- a/php/modules/Album.php +++ b/php/modules/Album.php @@ -723,11 +723,11 @@ class Album extends Module { # Call plugins $this->plugins(__METHOD__, 0, func_get_args()); - $albumID = reset($this->albumIDs); - $mergable_albumIDs = array_slice($this->albumIDs, 1); + $albumIDs = explode(',', $this->albumIDs); + $albumID = array_splice($albumIDs, 0, 1)[0]; - $inQuery = implode(',', array_fill(0, count($this->albumIDs) - 1, '?')); - $data = array(LYCHEE_TABLE_PHOTOS, $albumID) + $mergable_albumIDs; + $inQuery = implode(',', array_fill(0, count($albumIDs), '?')); + $data = array_merge(array(LYCHEE_TABLE_PHOTOS, $albumID), $albumIDs); $merge_query = Database::prepare($this->database, "UPDATE ? SET album = ? WHERE album IN ($inQuery)", $data); $merge_result = $this->database->query($merge_query); @@ -737,7 +737,7 @@ class Album extends Module { return false; } - $data = array(LYCHEE_TABLE_ALBUMS) + $mergable_albumIDs; + $data = array_merge( array(LYCHEE_TABLE_ALBUMS), $albumIDs); $delete_query = Database::prepare($this->database, "DELETE FROM ? WHERE id IN ($inQuery)", $data); $delete_result = $this->database->query($delete_query);