Functions and Logic per Module - nss-day-cohort-16/d16-gp-movie-history-team-scrappy GitHub Wiki
Controller
CreateListeners
Call search(input);
call showUntracked() on toggle
call showTracked() on toggle
call showWatched() on toggle
call showFavorites() on toggle
listen to stars (nate will let you know how to do that once he renders stars). call Model.UpdateRating(movieId, rating)
Model
Check if someone is logged in (calls loadPage with argument yes or no)
search(input): use getUser() then call Firebase.searchFirebase(input) if applicable and OpenMovies.getMovies(input), save input, and call signIn something, then call compare(), renderMovies(object, search)
compare(result1, result2) returns 1 json file of unique moveies
showUntracked() run compare and return only results that do not have firebase uid, then call renderMovies(object, untracked)
showUnwatched() will call getWatched(false), then call renderMovies(object, unwatched)
showWatched() will call getWatched(true), then call renderMovies(object, watched)
showFavorites(), then call renderMovies(object, favorites)
AddMovie(movieId) will call getFullMovie(imdbID), call Firebase.addMovie(object), call renderCard(object)
DeleteMovie(movieId) will call hideMovie(),
UpdateRating(movieId, rating) will change object then call renderCard(object) with new object
addToWatchList(movieId) push new object to firebase will call renderCard(object),
Call getUser() on page load, then call LoadPage(loggedIn).
View
loadPage(loggedIn) takes yes or no. show sectoin-home OR section-unwatched