static function remove_album_cover($album) { parent::remove_album_cover($album); if ($album->id > 1) { aws_s3::remove_item($album); } }
static function item_updated($old_item, $new_item) { if ($new_item->id == 1) { return true; } if ($new_item->has_aws_s3_meta()) { aws_s3::log("Item updated - " . $new_item->id); if ($old_item->relative_path() == $new_item->relative_path() && $old_item->s3_item_hash == $new_item->s3_item_hash) { aws_s3::log("nothing changed?!"); } else { if ($old_item->relative_path() != $new_item->relative_path()) { aws_s3::log("Item moved..."); aws_s3::move_item($old_item, $new_item); } else { aws_s3::log("Item hasn't moved. Image updated?"); aws_s3::remove_item($old_item); aws_s3::schedule_item_sync($new_item); } } } }
static function item_deleted($item) { aws_s3::log("Item deleted - " . $item->id); aws_s3::remove_item($item); }