mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-07-26 17:54:10 -04:00
Refactor the creation and removal of the album covers into
make_album_cover and remove_album_cover methods in Item_Model. Usage: $photo->make_album_cover() $album->remove_album_cover()
This commit is contained in:
@@ -54,17 +54,7 @@ class organize_task_Core {
|
||||
break;
|
||||
case "albumCover":
|
||||
$item = ORM::factory("item", $id);
|
||||
$parent = $item->parent();
|
||||
|
||||
if ($item->is_photo()) {
|
||||
$parent->album_cover_item_id = $item->id;
|
||||
} else if ($item->is_album()) {
|
||||
$parent->album_cover_item_id = $item->album_cover_item_id;
|
||||
}
|
||||
|
||||
$parent->thumb_dirty = 1;
|
||||
$parent->save();
|
||||
graphics::generate($parent);
|
||||
$item->make_album_cover();
|
||||
break;
|
||||
case "delete":
|
||||
$item = ORM::factory("item", $id);
|
||||
|
||||
Reference in New Issue
Block a user