Album status

This commit is contained in:
Gregory Eremin
2011-09-14 20:54:39 +04:00
parent 67b6899f9f
commit da97b4d4fc
4 changed files with 11 additions and 2 deletions
+1 -1
View File
@@ -81,7 +81,7 @@ class ArtistController < ApplicationController
@artist[:albums] = []
artist.albums.each do |album|
if @@default_album_types.include? album.album_type
if @@default_album_types.include? album.album_type and album.status == 1
tmp_album = {id: album.id, name: album.name, year: album.year, pic: album.pic_url}
album_tracks = []
bonus_tracks = []
+3
View File
@@ -48,6 +48,7 @@ class ImportController < ApplicationController
album.album_type = brainz_release_group.type
album.pic_url = album_image
album.has_pic = (album_image != '' and not album_image.nil?)
album.status = 0
dry_run ? ap(album) : album.save
# Tracks from the first release
tracks_hashed = []
@@ -72,6 +73,8 @@ class ImportController < ApplicationController
dry_run ? ap(track) : track.save
end
end
album.status = 1
album.save unless dry_run
end
artist.status = 1