Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
env.js

node_modules
.DS_Store
6 changes: 5 additions & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ pg.connect(process.env.DATABASE_URL, function(err, client) {
console.log(JSON.stringify(row));
});
});
// Wow, this is interesting! You could use Sequelize to take care of all this...


// var User = require("./db/connection").models.User;
Expand All @@ -39,7 +40,7 @@ if (fs.existsSync("./env.js")){
else {
var env = process.env;
}

// You shouldn't need FS to require a file.

var passport = require("passport")
var SpotifyStrategy = require("passport-spotify").Strategy;
Expand All @@ -61,6 +62,7 @@ passport.use(new SpotifyStrategy({
// console.log(user.get({
// plain: true
// }))
// Lots of commented-out stuff hanging around in here
console.log(created)
});
}
Expand Down Expand Up @@ -134,3 +136,5 @@ app.get('/auth/spotify/callback',
// app.listen(3000, function(){
// console.log("Listening on port 3000");
// });

// This is a really long app.js! Might be a good idea to extract stuff into other files. For instance, you could put all the Spotify Passport stuff in a separate file and `require` it. It would still load and run when you start your app.
6 changes: 6 additions & 0 deletions controllers/playlists.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ router.get("/playlists", function(req, res){
})

});
// User.findOne({ where: {spotifyId: req.session.profile.id}})
// .then(function(user){
// return Playlist.findAll({where: {userId: user.id}})
// }).then(function(playlists, err){
// res.json(playlists);
// });
});

//POST to playlists
Expand Down
2 changes: 2 additions & 0 deletions env.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ consumerKey: "ebc5b7965dcd40d5ba4fe24e80e0aeb8",
consumerSecret: "0812e8628dcd4752b05db36cc76ee833",
callbackUrl: "https://theplaylistr.herokuapp.com/auth/spotify/callback"
}

// This was included in your Github repo. I'm not sure why .gitignore didn't work. On the plus side, it made it a lot easier to test your app!
1 change: 1 addition & 0 deletions public/js/models/playlist.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ Playlist.prototype = {
destroy: function() {
// console.log("in destroy");
//console.log(data);
// So much commented-out code!
var url = "https://theplaylistr.herokuapp.com/playlists/" + this.id;
var request = $.ajax({
url: url,
Expand Down
8 changes: 5 additions & 3 deletions public/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ function getArtistBio(artist) {
appendArtistBio(artistBio);
})
}

// I would have extracted all of this "artist" stuff into a separate Artist model. Remember that models are just a way of organizing code related to a certain kind of data -- but they don't HAVE to connect to a database.
// display the artist bio in the .biography div
function appendArtistBio(artistBio){
$(".biography").html("");
Expand Down Expand Up @@ -179,7 +179,7 @@ function getConcertInfo(artist) {
appendConcertInfo(events);
})
}

// In the same lieu as artists, a concert model might be a good idea.
// display concert info, including link to event, venue and ticket purchase link
function appendConcertInfo(events){
$(".concerts").children().remove();
Expand Down Expand Up @@ -306,7 +306,7 @@ $('.otherLocation').keypress(function(e) {
}
});


// Put this in a separate file
// song lyric array for random song lyrics at bottom
var songLyrics = ["There was something so pleasant about that place.", "I wanna dance tonight. I wanna toast tonight.", "My umi said shine your light on the world.", "Making momma so proud. But your voice is too loud.", "Crank up the Beach Boys baby, don\'t let the music stop.", "Showin\' how funky strong is your fight", "Somebody said you got a new friend.", "I get jealous, but I\'m too cool to admit it.", "You gotta give me everything, baby, ain\'t no doubt. Need U 100%.", "Et si je compte et je compterai pour toi, je te conterai mes histoires.", "You’re kind of amazing like a time machine.", "The Digital Buddha is coming for you.", "On my tricycle, I’m in heaven, she’s my tricycle, I’m her melon.", "My ship at sail can climb a mountain, Ride it to the sky.", "You look like someone I know, where did I meet you and where do we go?", "And hope fuels generations. And hope can start your car. And hope is the root of fantasy. It\'s nothing but a star.", "And I found peace on the waiting room floor.", "You make me feel alive like a parachute in the sky", "Welcome to the crazy part of town. We like to take your life and turn it upside down", "In the shadow of the digital buddha are the countless wise, to bring you inspiration that you cannot buy.", "In the shadow of the digital buddha are the countless wise, to lift our generation to the highest high.", "Cheers to you it\'s like a dream you live by seeking fortunes at the door", "Baby I\'m in space when I\'m with you... Floating around nothing to do, maybe we can take a walk on the moon", "I can see it in your eyes, that you don\'t know what to say, I say goodbye, and walk away", "Cause tonight we can\'t do anything wrong", "Take me down to 34th street, where The Disco Biscuits are the king of the beat.", "Is there a pot of gold, at the end of this sweet rainbow?", "Always knew my home was in paradise.", "Hey little baby, now the morning\'s here. Gonna open my eyes, don\'t disappear."]

Expand All @@ -319,3 +319,5 @@ function getLyric() {
$(document).ready(function(){
$(".songLyrics").html(getLyric());
})

// This file's like 250 lines too long!
1 change: 1 addition & 0 deletions public/js/views/playlistView.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ PlaylistView.prototype = {
self.playlist.destroy(data).then(function() { self.$el.fadeOut()});
});
},
// If all these methods are part of the Playlist object, you don't really need to put "playlist" in the methods' names
updatePlaylist: function() {
var self = this;
// console.log(this.playlist.id);
Expand Down
1 change: 1 addition & 0 deletions public/js/views/userView.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ var UserView = function(user){
this.user = user;
this.$el = $("<div class='user'></div>");
};
// Goodness!
//
// User.fetch = function(){
// // saving the ajax request to a local variable
Expand Down