From a59442afcb277fd3fb3d306daa59ab6d9c15c342 Mon Sep 17 00:00:00 2001 From: Avichai Date: Wed, 21 Nov 2018 01:46:07 -0500 Subject: [PATCH] Comment back in seed files --- db/seeds.rb | 289 +++++++++++++++++++++++++--------------------------- 1 file changed, 140 insertions(+), 149 deletions(-) diff --git a/db/seeds.rb b/db/seeds.rb index 955da58..b52bf6c 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -17,21 +17,14 @@ # file = EzDownload.open('https://s3.amazonaws.com/spoofify-dev/face.jpg') def create_user(params, filename) - puts "In create user #{params}, #{filename}" user = User.new(params) - puts "getting #{filename}" file = EzDownload.open("https://s3.amazonaws.com/spoofify-dev/photos/#{filename}") - puts "got #{filename}" - puts file user.photo.attach(io: file, filename: filename) - puts "saving" user.save! - puts "saved" return user end def create_album(params, filename) - puts "In create album #{params}, #{filename}" album = Album.new(params) file = EzDownload.open("https://s3.amazonaws.com/spoofify-dev/photos/#{filename}") album.photo.attach(io: file, filename: filename) @@ -40,7 +33,6 @@ def create_album(params, filename) end def create_artist(params, filename) - puts "In create artist #{params}, #{filename}" artist = Artist.new(params) file = EzDownload.open("https://s3.amazonaws.com/spoofify-dev/photos/#{filename}") artist.photo.attach(io: file, filename: filename) @@ -49,7 +41,6 @@ def create_artist(params, filename) end def create_song(params, filename) - puts "In create song #{params}, #{filename}" song = Song.new(params) file = EzDownload.open("https://s3.amazonaws.com/spoofify-dev/tracks/#{filename}") song.track.attach(io: file, filename: filename) @@ -58,146 +49,146 @@ def create_song(params, filename) end spotify = create_user({username: 'Spotify', password: 'starwars', email: 'spotify@guest.com'}, 'face.jpg') -# guest = create_user({username: 'Guest', password: 'password', email: 'guest@guest.com'}, 'face.jpg') -# paul = create_user({username: 'PaulTheWise', password: 'password', email: 'guest2@guest.com'}, 'PaulTheWise.jpg') -# dusty = create_user({username: 'Dusty', password: 'password', email: 'guest3@guest.com'}, 'dusty.jpg') -# trev = create_user({username: 'Trev', password: 'password', email: 'guest4@guest.com'}, 'Trev.jpg') -# mafe = create_user({username: 'Mafe', password: 'password', email: 'guest5@guest.com'}, 'Mafe.jpg') -# keith = create_user({username: 'Keith', password: 'password', email: 'guest6@guest.com'}, 'Keith.jpg') -# nathan = create_user({username: 'Nathan', password: 'password', email: 'guest7@guest.com'}, 'Nathan.jpg') -# hobbes = create_user({username: 'Hobbes', password: 'password', email: 'guest8@guest.com'}, 'face.jpg') -# unique = create_user({username: 'UniqueUsername', password: 'password', email: 'guest9@guest.com'}, 'face.jpg') -# william = create_user({username: 'Williamnot', password: 'password', email: 'guest10@guest.com'}, 'Williamnot.jpg') -# paul2 = create_user({username: 'PaulAsCalvin', password: 'password', email: 'guest11@guest.com'}, 'PaulAsCalvin.jpg') -# -# chilipeppers = create_artist({ name: 'Red Hot Chili Peppers'}, 'artist_chilipeppers.jpg') -# mattcorby = create_artist({ name: 'Matt Corby'}, 'artist_mattcorby.jpg') -# sammhenshaw = create_artist({ name: 'Samm Henshaw'}, 'artist_sammhenshaw.jpg') -# instrumentals = create_artist({ name: 'Intrumentals'}, 'artist_instrumental.jpg.jpg') -# matisyahu = create_artist({ name: 'Matisyahu'}, 'artist_matisyahu.jpg') -# yebba = create_artist({ name: 'Yebba' }, 'artist_yebba.jpg') -# gambino = create_artist({ name: 'Childish Gambino'}, 'artist_gambino.jpg') -# dragons = create_artist({ name: 'Imagine Dragons'}, 'artist_dragons.jpg') -# classical = create_artist({ name: 'Classics'}, 'artist_classical.jpg') -# -# bytheway = create_album({title: 'By the Way'}, 'chilipeppers.jpg') -# monday = create_album({title: 'Monday'}, 'corby.jpg') -# hands = create_album({title: 'Hands'}, 'cat.jpeg') -# wave = create_album({title: 'Surf'}, 'wave.jpg') -# sunshine = create_album({title: 'Sunshine'}, 'matisyahu.jpg') -# jelly = create_album({title: 'Keep Swimming'}, 'jellyfish.jpg') -# evergreen = create_album({title: 'Evergreen'}, 'bird.jpeg') -# demons = create_album({title: 'Demons'}, 'splash6.jpg') -# light = create_album({title: 'Light'}, 'splash5.jpg') -# lift = create_album({title: 'Lift'}, 'splash4.jpg') -# come = create_album({title: 'Come together'}, 'splash3.jpg') -# explore = create_album({title: 'Explore'}, 'splash2.jpg') -# mindless = create_album({title: 'Mindless'}, 'splash.jpg') -# -# www = create_song({title: 'Californication', album_id: bytheway.id}, 'Californication.mp3') -# zzz = create_song({title: 'Snow', album_id: bytheway.id}, 'Snow.mp3') -# a = create_song({title: 'Scar Tissue', album_id: bytheway.id}, 'Scar+Tissue.mp3') -# b = create_song({title: 'Around The World', album_id: bytheway.id}, 'Around+The+World.mp3') -# c = create_song({title: 'Under The Bridge', album_id: bytheway.id}, 'Under+The+Bridge.mp3') -# d = create_song({title: 'Otherwise', album_id: bytheway.id}, 'Otherwise.mp3') -# -# chilipeppers.songs += [a, b, c, d, zzz, www] -# -# e = create_song({title: 'Monday', album_id: monday.id}, 'Monday.mp3') -# f = create_song({title: 'Brother', album_id: monday.id}, 'Brother.mp3') -# g = create_song({title: 'Trick of the light', album_id: monday.id}, 'Matt+Corby+-+Trick+of+the+light.mp3') -# h = create_song({title: 'Wrong Man', album_id: monday.id}, 'Matt+Corby+-+Wrong+Man.mp3') -# i = create_song({title: 'Knife Edge', album_id: monday.id}, 'Matt+Corby+-+Knife+Edge.mp3') -# j = create_song({title: 'Resolution', album_id: monday.id}, 'Matt+Corby+-+Resolution.mp3') -# -# mattcorby.songs += [e, f, g, h, i, j] -# -# k = create_song({title: 'These Hands', album_id: hands.id}, 'These+Hands.mp3') -# l = create_song({title: 'Better', album_id: hands.id}, 'Better.mp3') -# -# sammhenshaw.songs += [k, l] -# -# m = create_song({title: 'Bolt', album_id: wave.id}, 'Bolt.mp3') -# instrumentals.songs += [m] -# -# q = create_song({title: 'Warrior', album_id: sunshine.id}, 'Matisyahu+-+Warrior.mp3') -# r = create_song({title: 'Time Of Your Song', album_id: sunshine.id}, 'Matisyahu+-+Time+Of+Your+Song.mp3') -# s = create_song({title: 'King Without a Crown', album_id: sunshine.id}, 'Matisyahu+-+King+Without+a+Crown.mp3') -# -# matisyahu.songs += [q, r, s] -# -# t = create_song({title: 'Evergreen', album_id: evergreen.id}, 'YEBBA.mp3') -# u = create_song({title: 'My Mind (live)', album_id: evergreen.id}, 'My+Mind+(live).mp3') -# v = create_song({title: 'Weak (cover', album_id: evergreen.id}, 'Weak+(cover.mp3') -# w = create_song({title: 'No Peace', album_id: evergreen.id}, 'No+Peace.mp3') -# x = create_song({title: 'Why My Day Will Come', album_id: evergreen.id}, 'Why+My+Day+Will+Come.mp3') -# -# yebba.songs += [t, u, v, w, x] -# -# y = create_song({title: 'Demons', album_id: demons.id}, 'Demons.mp3') -# z = create_song({title: 'Amsterdam', album_id: demons.id}, 'Amsterdam.mp3') -# aa = create_song({title: 'On Top Of The World', album_id: demons.id}, 'On+Top+Of+The+World.mp3') -# bb = create_song({title: 'Thunder', album_id: demons.id}, 'Thunder.mp3') -# cc = create_song({title: 'Natural', album_id: demons.id}, 'Natural.mp3') -# dd = create_song({title: 'Believer', album_id: demons.id}, 'Believer.mp3') -# -# dragons.songs += [y, z, aa, bb, cc, dd] -# -# ee = create_song({title: 'Instrumental Joy', album_id: light.id}, 'Instrumental1.mp3') -# ff = create_song({title: 'Instrumental Pleasure', album_id: light.id}, 'Instrumental2.mp3') -# gg = create_song({title: 'Instrumental Fun', album_id: light.id}, 'Instrumental3.mp3') -# hh = create_song({title: 'Instrumental Desire', album_id: light.id}, 'Instrumental4.mp3') -# ii = create_song({title: 'Instrumental Fire', album_id: light.id}, 'Instrumental5.mp3') -# jj = create_song({title: 'Instrumental Dive', album_id: light.id}, 'Instrumental6.mp3') -# kk = create_song({title: 'Instrumental Words', album_id: light.id}, 'Instrumental7.mp3') -# -# instrumentals.songs += [ee, ff, gg, hh, ii, jj, kk] -# -# ll = create_song({title: 'Zombies', album_id: lift.id}, 'Zombies.mp3') -# mm = create_song({title: 'Summertime Magic', album_id: lift.id}, 'Summertime+Magic.mp3') -# nn = create_song({title: 'Sober', album_id: lift.id}, 'Sober.mp3') -# oo = create_song({title: 'IV. Sweatpants.mp3', album_id: lift.id}, 'IV.+Sweatpants.mp3') -# pp = create_song({title: 'This Is America', album_id: lift.id}, 'This+Is+America.mp3') -# qq = create_song({title: 'Feels Like Summer', album_id: lift.id}, 'Feels+Like+Summer.mp3') -# rr = create_song({title: 'Redbone', album_id: lift.id}, 'Redbone.mp3') -# -# gambino.songs += [ll, mm, nn, oo, pp, qq, rr] -# -# ss = create_song({title: 'Original classic', album_id: come.id}, 'Sounds+of+Nature1.mp3') -# tt = create_song({title: 'Unoriginal classic', album_id: come.id}, 'Sounds+of+Nature2.mp3') -# uu = create_song({title: 'Classically classic', album_id: come.id}, 'Sounds+of+Nature3.mp3') -# vv = create_song({title: 'Classically original', album_id: come.id}, 'Sounds+of+Nature4.mp3') -# ww = create_song({title: 'Gift of Nature', album_id: explore.id}, 'Sounds+of+Nature5.mp3') -# xx = create_song({title: 'Gift of Life', album_id: explore.id}, 'Sounds+of+Nature6.mp3') -# yy = create_song({title: 'Classical Tune', album_id: mindless.id}, 'classical1.mp3') -# zz = create_song({title: 'Crossroads', album_id: mindless.id}, 'classical2.mp3') -# aaa = create_song({title: 'Choices', album_id: mindless.id}, 'classical3.mp3') -# bbb = create_song({title: 'Change', album_id: mindless.id}, 'classical5.mp3') -# ccc = create_song({title: 'Time', album_id: mindless.id}, 'classical6.mp3') -# -# classical.songs += [ss, tt, uu, vv, ww, xx, yy, zz, aaa, bbb, ccc] -# -# qqq = Playlist.create(title: 'Relax', author_id: spotify.id) -# Playlist.create(title: 'Chill', author_id: spotify.id) -# Playlist.create(title: 'Unwind', author_id: spotify.id) -# Playlist.create(title: 'Sublime', author_id: spotify.id) -# Playlist.create(title: 'Focus', author_id: paul.id) -# Playlist.create(title: 'Energize', author_id: paul2.id) -# ppp = Playlist.create(title: 'Commute', author_id: guest.id) -# Playlist.create(title: 'Exercise', author_id: guest.id) -# Playlist.create(title: 'Dance', author_id: mafe.id) -# Playlist.create(title: 'Reflect', author_id: william.id) -# Playlist.create(title: 'Party', author_id: trev.id) -# Playlist.create(title: 'Run', author_id: spotify.id) -# Playlist.create(title: 'Art', author_id: dusty.id) -# Playlist.create(title: 'Indie', author_id: guest.id) -# Playlist.create(title: 'Unique', author_id: unique.id) -# Playlist.create(title: 'Math', author_id: nathan.id) -# Playlist.create(title: 'Melofy', author_id: keith.id) -# Playlist.create(title: 'Magical World', author_id: hobbes.id) -# -# qqq.songs += [q, ss, h, t] -# ppp.songs += [k, l, q] +guest = create_user({username: 'Guest', password: 'password', email: 'guest@guest.com'}, 'face.jpg') +paul = create_user({username: 'PaulTheWise', password: 'password', email: 'guest2@guest.com'}, 'PaulTheWise.jpg') +dusty = create_user({username: 'Dusty', password: 'password', email: 'guest3@guest.com'}, 'dusty.jpg') +trev = create_user({username: 'Trev', password: 'password', email: 'guest4@guest.com'}, 'Trev.jpg') +mafe = create_user({username: 'Mafe', password: 'password', email: 'guest5@guest.com'}, 'Mafe.jpg') +keith = create_user({username: 'Keith', password: 'password', email: 'guest6@guest.com'}, 'Keith.jpg') +nathan = create_user({username: 'Nathan', password: 'password', email: 'guest7@guest.com'}, 'Nathan.jpg') +hobbes = create_user({username: 'Hobbes', password: 'password', email: 'guest8@guest.com'}, 'face.jpg') +unique = create_user({username: 'UniqueUsername', password: 'password', email: 'guest9@guest.com'}, 'face.jpg') +william = create_user({username: 'Williamnot', password: 'password', email: 'guest10@guest.com'}, 'Williamnot.jpg') +paul2 = create_user({username: 'PaulAsCalvin', password: 'password', email: 'guest11@guest.com'}, 'PaulAsCalvin.jpg') + +chilipeppers = create_artist({ name: 'Red Hot Chili Peppers'}, 'artist_chilipeppers.jpg') +mattcorby = create_artist({ name: 'Matt Corby'}, 'artist_mattcorby.jpg') +sammhenshaw = create_artist({ name: 'Samm Henshaw'}, 'artist_sammhenshaw.jpg') +instrumentals = create_artist({ name: 'Intrumentals'}, 'artist_instrumental.jpg.jpg') +matisyahu = create_artist({ name: 'Matisyahu'}, 'artist_matisyahu.jpg') +yebba = create_artist({ name: 'Yebba' }, 'artist_yebba.jpg') +gambino = create_artist({ name: 'Childish Gambino'}, 'artist_gambino.jpg') +dragons = create_artist({ name: 'Imagine Dragons'}, 'artist_dragons.jpg') +classical = create_artist({ name: 'Classics'}, 'artist_classical.jpg') + +bytheway = create_album({title: 'By the Way'}, 'chilipeppers.jpg') +monday = create_album({title: 'Monday'}, 'corby.jpg') +hands = create_album({title: 'Hands'}, 'cat.jpeg') +wave = create_album({title: 'Surf'}, 'wave.jpg') +sunshine = create_album({title: 'Sunshine'}, 'matisyahu.jpg') +jelly = create_album({title: 'Keep Swimming'}, 'jellyfish.jpg') +evergreen = create_album({title: 'Evergreen'}, 'bird.jpeg') +demons = create_album({title: 'Demons'}, 'splash6.jpg') +light = create_album({title: 'Light'}, 'splash5.jpg') +lift = create_album({title: 'Lift'}, 'splash4.jpg') +come = create_album({title: 'Come together'}, 'splash3.jpg') +explore = create_album({title: 'Explore'}, 'splash2.jpg') +mindless = create_album({title: 'Mindless'}, 'splash.jpg') + +www = create_song({title: 'Californication', album_id: bytheway.id}, 'Californication.mp3') +zzz = create_song({title: 'Snow', album_id: bytheway.id}, 'Snow.mp3') +a = create_song({title: 'Scar Tissue', album_id: bytheway.id}, 'Scar+Tissue.mp3') +b = create_song({title: 'Around The World', album_id: bytheway.id}, 'Around+The+World.mp3') +c = create_song({title: 'Under The Bridge', album_id: bytheway.id}, 'Under+The+Bridge.mp3') +d = create_song({title: 'Otherwise', album_id: bytheway.id}, 'Otherwise.mp3') + +chilipeppers.songs += [a, b, c, d, zzz, www] + +e = create_song({title: 'Monday', album_id: monday.id}, 'Monday.mp3') +f = create_song({title: 'Brother', album_id: monday.id}, 'Brother.mp3') +g = create_song({title: 'Trick of the light', album_id: monday.id}, 'Matt+Corby+-+Trick+of+the+light.mp3') +h = create_song({title: 'Wrong Man', album_id: monday.id}, 'Matt+Corby+-+Wrong+Man.mp3') +i = create_song({title: 'Knife Edge', album_id: monday.id}, 'Matt+Corby+-+Knife+Edge.mp3') +j = create_song({title: 'Resolution', album_id: monday.id}, 'Matt+Corby+-+Resolution.mp3') + +mattcorby.songs += [e, f, g, h, i, j] + +k = create_song({title: 'These Hands', album_id: hands.id}, 'These+Hands.mp3') +l = create_song({title: 'Better', album_id: hands.id}, 'Better.mp3') + +sammhenshaw.songs += [k, l] + +m = create_song({title: 'Bolt', album_id: wave.id}, 'Bolt.mp3') +instrumentals.songs += [m] + +q = create_song({title: 'Warrior', album_id: sunshine.id}, 'Matisyahu+-+Warrior.mp3') +r = create_song({title: 'Time Of Your Song', album_id: sunshine.id}, 'Matisyahu+-+Time+Of+Your+Song.mp3') +s = create_song({title: 'King Without a Crown', album_id: sunshine.id}, 'Matisyahu+-+King+Without+a+Crown.mp3') + +matisyahu.songs += [q, r, s] + +t = create_song({title: 'Evergreen', album_id: evergreen.id}, 'YEBBA.mp3') +u = create_song({title: 'My Mind (live)', album_id: evergreen.id}, 'My+Mind+(live).mp3') +v = create_song({title: 'Weak (cover', album_id: evergreen.id}, 'Weak+(cover.mp3') +w = create_song({title: 'No Peace', album_id: evergreen.id}, 'No+Peace.mp3') +x = create_song({title: 'Why My Day Will Come', album_id: evergreen.id}, 'Why+My+Day+Will+Come.mp3') + +yebba.songs += [t, u, v, w, x] + +y = create_song({title: 'Demons', album_id: demons.id}, 'Demons.mp3') +z = create_song({title: 'Amsterdam', album_id: demons.id}, 'Amsterdam.mp3') +aa = create_song({title: 'On Top Of The World', album_id: demons.id}, 'On+Top+Of+The+World.mp3') +bb = create_song({title: 'Thunder', album_id: demons.id}, 'Thunder.mp3') +cc = create_song({title: 'Natural', album_id: demons.id}, 'Natural.mp3') +dd = create_song({title: 'Believer', album_id: demons.id}, 'Believer.mp3') + +dragons.songs += [y, z, aa, bb, cc, dd] + +ee = create_song({title: 'Instrumental Joy', album_id: light.id}, 'Instrumental1.mp3') +ff = create_song({title: 'Instrumental Pleasure', album_id: light.id}, 'Instrumental2.mp3') +gg = create_song({title: 'Instrumental Fun', album_id: light.id}, 'Instrumental3.mp3') +hh = create_song({title: 'Instrumental Desire', album_id: light.id}, 'Instrumental4.mp3') +ii = create_song({title: 'Instrumental Fire', album_id: light.id}, 'Instrumental5.mp3') +jj = create_song({title: 'Instrumental Dive', album_id: light.id}, 'Instrumental6.mp3') +kk = create_song({title: 'Instrumental Words', album_id: light.id}, 'Instrumental7.mp3') + +instrumentals.songs += [ee, ff, gg, hh, ii, jj, kk] + +ll = create_song({title: 'Zombies', album_id: lift.id}, 'Zombies.mp3') +mm = create_song({title: 'Summertime Magic', album_id: lift.id}, 'Summertime+Magic.mp3') +nn = create_song({title: 'Sober', album_id: lift.id}, 'Sober.mp3') +oo = create_song({title: 'IV. Sweatpants.mp3', album_id: lift.id}, 'IV.+Sweatpants.mp3') +pp = create_song({title: 'This Is America', album_id: lift.id}, 'This+Is+America.mp3') +qq = create_song({title: 'Feels Like Summer', album_id: lift.id}, 'Feels+Like+Summer.mp3') +rr = create_song({title: 'Redbone', album_id: lift.id}, 'Redbone.mp3') + +gambino.songs += [ll, mm, nn, oo, pp, qq, rr] + +ss = create_song({title: 'Original classic', album_id: come.id}, 'Sounds+of+Nature1.mp3') +tt = create_song({title: 'Unoriginal classic', album_id: come.id}, 'Sounds+of+Nature2.mp3') +uu = create_song({title: 'Classically classic', album_id: come.id}, 'Sounds+of+Nature3.mp3') +vv = create_song({title: 'Classically original', album_id: come.id}, 'Sounds+of+Nature4.mp3') +ww = create_song({title: 'Gift of Nature', album_id: explore.id}, 'Sounds+of+Nature5.mp3') +xx = create_song({title: 'Gift of Life', album_id: explore.id}, 'Sounds+of+Nature6.mp3') +yy = create_song({title: 'Classical Tune', album_id: mindless.id}, 'classical1.mp3') +zz = create_song({title: 'Crossroads', album_id: mindless.id}, 'classical2.mp3') +aaa = create_song({title: 'Choices', album_id: mindless.id}, 'classical3.mp3') +bbb = create_song({title: 'Change', album_id: mindless.id}, 'classical5.mp3') +ccc = create_song({title: 'Time', album_id: mindless.id}, 'classical6.mp3') + +classical.songs += [ss, tt, uu, vv, ww, xx, yy, zz, aaa, bbb, ccc] + +qqq = Playlist.create(title: 'Relax', author_id: spotify.id) +Playlist.create(title: 'Chill', author_id: spotify.id) +Playlist.create(title: 'Unwind', author_id: spotify.id) +Playlist.create(title: 'Sublime', author_id: spotify.id) +Playlist.create(title: 'Focus', author_id: paul.id) +Playlist.create(title: 'Energize', author_id: paul2.id) +ppp = Playlist.create(title: 'Commute', author_id: guest.id) +Playlist.create(title: 'Exercise', author_id: guest.id) +Playlist.create(title: 'Dance', author_id: mafe.id) +Playlist.create(title: 'Reflect', author_id: william.id) +Playlist.create(title: 'Party', author_id: trev.id) +Playlist.create(title: 'Run', author_id: spotify.id) +Playlist.create(title: 'Art', author_id: dusty.id) +Playlist.create(title: 'Indie', author_id: guest.id) +Playlist.create(title: 'Unique', author_id: unique.id) +Playlist.create(title: 'Math', author_id: nathan.id) +Playlist.create(title: 'Melofy', author_id: keith.id) +Playlist.create(title: 'Magical World', author_id: hobbes.id) + +qqq.songs += [q, ss, h, t] +ppp.songs += [k, l, q] # # # a = Song.create!(album_id: 2, title: "Californication") # # b = Song.create!(album_id: 2, title: "Snow")