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:
Tim Almdal
2009-04-29 15:57:29 +00:00
parent 33122e8968
commit 820cbdf1c3
4 changed files with 30 additions and 32 deletions
+1 -11
View File
@@ -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);