Commit Graph

54 Commits

Author SHA1 Message Date
Chris Shyi
9d43048067 Clean up views.py and utils.py further
views.py and utils.py were cleaned up further to remove any obsolete usage of
library_stats.
2018-06-09 13:58:52 -04:00
Chris Shyi
92d5d174e8 Modify maximum field length
Artist.genre and Track.name had maximum lengths that were not long enough, now increased.
2018-06-08 20:08:17 -04:00
Chris Shyi
fd7a031bf2 Fix incorrect usage of update()
update() is a QuerySet method. To update a single object, use save().
2018-06-08 19:58:44 -04:00
Chris Shyi
0e69d3d190 Removed test_db.js 2018-06-08 19:50:50 -04:00
Chris Shyi
90dbda4336 Removed UserAudioSummary class 2018-06-08 19:47:51 -04:00
Chris Shyi
797115e9cb Clean up utils.py to use database
Uses of the original library_stats dictionary in utils.py were either removed or commented out, replaced by the saving of models into the database.
2018-06-08 18:45:16 -04:00
Chris Shyi
29ab115f91 Merge branch 'in-progress' of https://github.com/Kevin-Mok/spotify-lib-vis into in-progress 2018-06-07 22:15:11 -04:00
79aedc655d Trying to pass artist data from db to frontend 2018-06-07 21:48:38 -04:00
Chris Shyi
b66cf1dd87 Delete all migrations and start anew
Deleted all migrations and started anew to incorporate changes in models.
2018-06-06 20:56:40 -04:00
Chris Shyi
3ee6bb50a5 Merge branch 'database' of https://github.com/chrisshyi/spotify-lib-vis into database 2018-06-06 20:50:43 -04:00
Chris Shyi
77662a6a5e Merge branch 'database' of https://github.com/Kevin-Mok/spotify-lib-vis into database 2018-06-06 20:46:40 -04:00
62cc6c8ccd Setup AudioFeatures table 2018-06-06 05:36:00 -04:00
cdcc33c014 Setup Track table, modified models to data
Recreated migrations from scratch to fix bug with initializing Track
objects.
2018-06-06 03:46:09 -04:00
Chris Shyi
27718743d7 Change artists field in Track
artists is now a ManyToManyField in Track, which is cleaner than
using a unique_together clause in the Meta class.
2018-06-05 19:55:36 -04:00
Chris Shyi
b735887899 Bug fixes
Server crashes as of the last commit, now fixed.
2018-06-04 22:17:31 -04:00
549af96db7 Setup Artist table
Removed printing of library_stats.
2018-06-04 21:52:30 -04:00
c17d318f7d Merge branch 'master' of https://github.com/Kevin-Mok/spotify-lib-vis into database
Removed some lines that prevented program from running.
2018-06-04 21:20:35 -04:00
Chris Shyi
248e9b0ab6 Change database settings
Edited settings.py to use PostgreSQL. Made some minor changes
in views.py to incorporate the new models.
2018-06-04 17:31:54 -04:00
e07fd0965a Added Vim folds to models.py and utils.py 2018-06-04 17:21:18 -04:00
Chris Shyi
3fdf3029e2 Merge branch 'database' of https://github.com/Kevin-Mok/spotify-lib-vis 2018-06-04 09:41:43 -04:00
Chris Shyi
6380ba9c16 Merge branch 'master' of https://github.com/chrisshyi/spotify-lib-vis 2018-06-04 09:39:38 -04:00
Chris Shyi
e5151a1b92 Add user_data.js
Script will be used to obtain data from server for D3 consumption.
2018-06-04 09:38:38 -04:00
9fb37f0615 Wrote up proposed model design for database
Have not actually created any models yet.
2018-06-03 19:14:34 -04:00
Chris Shyi
0796e4190d Merge branch 'master' of https://github.com/chrisshyi/spotify-lib-vis 2018-06-03 16:55:36 -04:00
Chris Shyi
003c630dd4 Fix audio feature analysis missing bug
Added error checking for missing audio features in the Spotify database.
2018-06-03 16:54:39 -04:00
Chris Shyi
f52e88f83a Start implementing AJAX
Problem with cross origin requests, need to do more research.
2018-06-03 16:04:26 -04:00
Chris Shyi
a508337363 Fix import in tests.py
tests.py was importing update_std_dev() from views.py (where the function was prior to
the refactor), now fixed.
2018-06-02 23:14:47 -04:00
53b7bb5d41 Started on (flawed) database models 2018-05-26 04:39:35 -04:00
c831e5b9a8 Initial design for database
Before considering Django models.
2018-05-23 23:36:38 -04:00
Chris Shyi
e01331f951 Process library_stats
library_stats is now processed into a format that's more easily consumed
by D3. Need to finalize format for popularity data.
2018-05-22 21:22:24 -04:00
Chris Shyi
46df571855 Compute the average and std_dev for popularity
Modified the structure and code in utils.py so that library_stats now
has a record of the mean and standard deviation of popularity.
2018-05-22 20:25:29 -04:00
Chris Shyi
c9de0395a4 Refactor helper functions in views.py
Refactored helper functions in views.py into utils.py. Instead of having
a global dictionary object for user library data, helper functions now
mutate a dictionary passed in as a parameter.
2018-05-22 18:11:56 -04:00
Chris Shyi
3a733e18b3 Added one more test for update_std_dev() 2018-05-21 12:05:43 -04:00
Chris Shyi
c6c4897ce0 Added four tests for update_std_dev() 2018-05-21 11:55:32 -04:00
96b7bfb2bb Display genre counts on user_data page
Able to pass dict info successfully from backend to webpage.
2018-05-20 23:11:35 -04:00
Chris Shyi
4b263532d1 Added missing space on line #222 2018-05-20 18:40:22 -04:00
6e1671b0f2 Fixed improper retrieval of value from API JSON 2018-05-20 17:52:41 -04:00
Chris Shyi
ec3fb3f959 Fix get_audio_features() bug
Fixed bug where the parameters passed in the wrong order for
get_audio_features().
2018-05-20 16:37:02 -04:00
Chris Shyi
4066c96c94 Changed signature of get_audio_features() for consistency
Switched around the ordering of the parameters so that they are
consistent with other data acquisition helper functions.
2018-05-20 16:35:19 -04:00
Chris Shyi
a5780387e1 Made minor changes to variable names 2018-05-20 16:31:51 -04:00
Chris Shyi
d7002f7571 Implement audio feature statistics calculation
Implemented the calculation average and standard deviation of audio features.
2018-05-20 16:28:46 -04:00
Chris Shyi
9878e7954d Merge branch 'master' of https://github.com/Kevin-Mok/spotify-lib-vis 2018-05-20 15:59:27 -04:00
Chris Shyi
bbc713e729 Implement audio feature helper functions
Implemented helper functions for updating audio feature statistics.
2018-05-20 15:55:59 -04:00
Chris Shyi
7b153649bf Implement online standard deviation algorithm
Implemented Welford's method for calculating standard deviation as data
points arrive.
2018-05-20 15:19:11 -04:00
f94a861b84 Calculate genre counts once for each artist (#1)
Versus last commit that incremented genres every track. Also now only
stores ID for artist rather than all their genres.
2018-05-19 23:39:10 -04:00
cb75a0b2bb Implemented get_genre functionality (#1)
Code actually in increase_artist_count. Updates genre counts with
each track from the artist.
2018-05-19 22:56:28 -04:00
0ca846805c Wrote parse_library and get_track_info (#1)
Initialized library_stats with top-level keys and default values.
2018-05-19 21:19:35 -04:00
Chris Shyi
41eca1c891 Get soundtrack musical features
Implemented get_features() to retrieve musical features for soundtracks
2018-05-18 21:20:13 -04:00
Chris
bf65ae3f4d Use different URI for user data
The user_data page is now located at /user_data, instead of /callback as
before. Closes #7.
2018-05-14 10:29:15 -04:00
Chris
c0fe7a61af Implement User Login
Closes #6. User can now log in and be redirected to a data display
page(needs to be fleshed out).
2018-05-13 22:51:52 -04:00