diff options
Diffstat (limited to 'core/helpers/core.php')
-rw-r--r-- | core/helpers/core.php | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/core/helpers/core.php b/core/helpers/core.php index f8c08ca9..4c73f148 100644 --- a/core/helpers/core.php +++ b/core/helpers/core.php @@ -31,14 +31,17 @@ class core_Core { static function move_item($source, $target) { access::required("edit", $source); access::required("edit", $target); + + $parent = $source->parent(); + if ($parent->album_cover_item_id == $source->id) { + $parent->remove_album_cover(); + } + $source->move_to($target); // If the target has no cover item, make this it. if ($target->album_cover_item_id == null) { - $target->album_cover_item_id = - $source->is_album() ? $source->album_cover_item_id : $source->id; - $target->save(); - graphics::generate($target); + $source->make_album_cover(); } } }
\ No newline at end of file |