Commit 898b869e authored by Deion Menor's avatar Deion Menor

Merge branch 'playlistwip' of ssh://gitlab.discs.ateneo.edu:15316/brian/mymusiclist into searchnav

parents f140b579 8d60a783
# run in Django shell ONLY!!!
# python manage.py shell
# >>> exec(open('./SQL/populate_songs.py').read())
from core.models import *
def extract_song_title(s):
clean = []
i = 1
for t in s.split(' ÷'):
if t == '': continue
u = t.strip('\n').split()
if u[0] == '.flac' or u[0] == '.mp3' or u[0] == '.dts':
clean.append(' '.join(t.strip('\n').split()[2:])[:-len(u[0])])
i += 1
return clean
def prettify_genre(g):
return ', '.join([h.replace('_',' ') for h in g.split()])
for song in Song.objects.filter(song_name__startswith="."):
songlst = extract_song_title(song.song_name)
for e in songlst:
Song.objects.create(song_name=e, genre=prettify_genre(song.genre), artist=song.artist, album=song.album)
# uncomment the next line if you want to delete the original entry after parsing
# song.delete()
# if something messed up above, uncomment these lines
# for song in Song.objects.exclude(song_name__startswith="."):
# song.delete()
\ No newline at end of file
...@@ -3,7 +3,7 @@ PRAGMA journal_mode = MEMORY; ...@@ -3,7 +3,7 @@ PRAGMA journal_mode = MEMORY;
BEGIN TRANSACTION; BEGIN TRANSACTION;
INSERT INTO `core_artist` VALUES (409,'Akon','No description available'),(2822,'Maroon 5','No description available'),(3457,'Calvin Harris','No description available'),(14571,'Taylor Swift','No description available'),(42820,'The Script','No description available'),(137257,'Avicii','No description available'),(204743,'Jason Derulo','No description available'),(209178,'Khalid','No description available'),(348773,'Imagine Dragons','No description available'),(383287,'Kendrick Lamar','No description available'),(463487,'ClariS','No description available'),(464253,'Ed Sheeran','No description available'),(475312,'Charlie Puth','No description available'),(613412,'One Direction','No description available'),(986658,'Kygo','No description available'),(1033658,'Zayn','No description available'),(1117531,'Halsey','No description available'),(1189739,'BTS','No description available'),(1243225,'LANY','No description available'),(1427741,'Niall Horan','No description available'); INSERT INTO `core_artist` VALUES (409,'Akon','No description available'),(2822,'Maroon 5','No description available'),(3457,'Calvin Harris','No description available'),(14571,'Taylor Swift','No description available'),(42820,'The Script','No description available'),(137257,'Avicii','No description available'),(204743,'Jason Derulo','No description available'),(209178,'Khalid','No description available'),(348773,'Imagine Dragons','No description available'),(383287,'Kendrick Lamar','No description available'),(463487,'ClariS','No description available'),(464253,'Ed Sheeran','No description available'),(475312,'Charlie Puth','No description available'),(613412,'One Direction','No description available'),(986658,'Kygo','No description available'),(1033658,'Zayn','No description available'),(1117531,'Halsey','No description available'),(1189739,'BTS','No description available'),(1243225,'LANY','No description available'),(1427741,'Niall Horan','No description available');
INSERT INTO `core_album` VALUES (5855,'Trouble',2003,409),(13544,'Konvicted',2006,409),(19129,'Songs About Jane',2002,2822),(19602,'I Created Disco',2007,3457),(30519,'Taylor Swift',2006,14571),(37318,'It Won''t Be Soon Before Long',2007,2822),(203718,'The Script',2008,42820),(295240,'Fearless',2008,14571),(311226,'Freedom',2008,409),(538314,'Ready for the Weekend',2009,3457),(710818,'Jason Derülo',2010,204743),(857392,'Hands All Over',2010,2822),(857450,'Science & Faith',2010,42820),(71829076,'Speak Now',2010,14571),(72002104,'Section.80',2011,383287),(72045386,'+',2011,464253),(72048111,'Future History',2011,204743),(72087084,'Up All Night',2011,613412),(72184080,'BIRTHDAY',2012,463487),(72237573,'Overexposed',2012,2822),(72285595,'Night Visions',2012,348773),(72286759,'#3',2012,42820),(72318070,'good kid, m.A.A.d city',2012,383287),(72318105,'Red',2012,14571),(72324214,'18 Months',2012,3457),(72335503,'Take Me Home',2012,613412),(72519340,'SECOND STORY',2013,463487),(72572571,'TRUE',2013,137257),(72577095,'Tattoos',2013,204743),(72619052,'Midnight Memories',2013,613412),(72701191,'Talk Dirty',2014,204743),(72731395,'PARTY TIME',2014,463487),(72740625,'×',2014,464253),(72783778,'V',2014,2822),(72792151,'No Sound Without Silence',2014,42820),(72817155,'1989',2014,14571),(72819437,'Motion',2014,3457),(72829519,'Four',2014,613412),(72902118,'Smoke + Mirrors',2015,348773),(72926857,'To Pimp a Butterfly',2015,383287),(72981909,'Everything Is 4',2015,204743),(73045308,'Badlands',2015,1117531),(73068131,'Stories',2015,137257),(73098814,'Made In the A.M.',2015,613412),(73155604,'Nine Track Mind',2016,475312),(73184511,'untitled unmastered.',2016,383287),(73198864,'Mind of Mine',2016,1033658),(73233717,'Cloud Nine',2016,986658); INSERT INTO `core_album` VALUES (5855,'Trouble',2003,409),(13544,'Konvicted',2006,409),(19129,'Songs About Jane',2002,2822),(19602,'I Created Disco',2007,3457),(30519,'Taylor Swift',2006,14571),(37318,'It Won''t Be Soon Before Long',2007,2822),(203718,'The Script',2008,42820),(295240,'Fearless',2008,14571),(311226,'Freedom',2008,409),(538314,'Ready for the Weekend',2009,3457),(710818,'Jason Derülo',2010,204743),(857392,'Hands All Over',2010,2822),(857450,'Science & Faith',2010,42820),(71829076,'Speak Now',2010,14571),(72002104,'Section.80',2011,383287),(72045386,'+',2011,464253),(72048111,'Future History',2011,204743),(72087084,'Up All Night',2011,613412),(72184080,'BIRTHDAY',2012,463487),(72237573,'Overexposed',2012,2822),(72285595,'Night Visions',2012,348773),(72286759,'#3',2012,42820),(72318070,'good kid, m.A.A.d city',2012,383287),(72318105,'Red',2012,14571),(72324214,'18 Months',2012,3457),(72335503,'Take Me Home',2012,613412),(72519340,'SECOND STORY',2013,463487),(72572571,'TRUE',2013,137257),(72577095,'Tattoos',2013,204743),(72619052,'Midnight Memories',2013,613412),(72701191,'Talk Dirty',2014,204743),(72731395,'PARTY TIME',2014,463487),(72740625,'×',2014,464253),(72783778,'V',2014,2822),(72792151,'No Sound Without Silence',2014,42820),(72817155,'1989',2014,14571),(72819437,'Motion',2014,3457),(72829519,'Four',2014,613412),(72902118,'Smoke + Mirrors',2015,348773),(72926857,'To Pimp a Butterfly',2015,383287),(72981909,'Everything Is 4',2015,204743),(73045308,'Badlands',2015,1117531),(73068131,'Stories',2015,137257),(73098814,'Made In the A.M.',2015,613412),(73155604,'Nine Track Mind',2016,475312),(73184511,'untitled unmastered.',2016,383287),(73198864,'Mind of Mine',2016,1033658),(73233717,'Cloud Nine',2016,986658);
INSERT INTO `core_song` VALUES (1,'.flac s28257036s Disc 1/01 - Locked Up.flac ÷ INSERT INTO `core_song`(`id`, `song_name`, `genre`, `song_length`, `lyrics`, `artist_id`, `album_id`) VALUES (1,'.flac s28257036s Disc 1/01 - Locked Up.flac ÷
.flac s23390085s Disc 1/02 - Trouble Nobody.flac ÷ .flac s23390085s Disc 1/02 - Trouble Nobody.flac ÷
.flac s30832094s Disc 1/03 - Bananza (Belly Dancer).flac ÷ .flac s30832094s Disc 1/03 - Bananza (Belly Dancer).flac ÷
.flac s31885803s Disc 1/04 - Gangsta (feat. Daddy T, Devyne & Picklehead).flac ÷ .flac s31885803s Disc 1/04 - Gangsta (feat. Daddy T, Devyne & Picklehead).flac ÷
......
from django.contrib import admin from django.contrib import admin
from core.models import *
# Register your models here. # Register your models here.
class AlbumAdmin(admin.ModelAdmin):
list_display = ('album_name', 'artist', 'year')
class ArtistAdmin(admin.ModelAdmin):
list_display = ('name',)
class SongAdmin(admin.ModelAdmin):
list_display = ('song_name', 'artist', 'album')
list_filter = ('artist', 'album',)
admin.site.register(Album, AlbumAdmin)
admin.site.register(Artist, ArtistAdmin)
admin.site.register(Song, SongAdmin)
\ No newline at end of file
from django.db import models from django.db import models
class user_account(models.Model): class UserAccount(models.Model):
id = models.AutoField(primary_key=True) id = models.AutoField(primary_key=True)
first_name = models.CharField(max_length=64) first_name = models.CharField(max_length=64)
last_name = models.CharField(max_length=64) last_name = models.CharField(max_length=64)
email = models.CharField(max_length=64) email = models.CharField(max_length=64)
class artist(models.Model): class Artist(models.Model):
id = models.AutoField(primary_key=True) id = models.AutoField(primary_key=True)
name = models.CharField(max_length=64) name = models.CharField(max_length=64)
description = models.TextField() description = models.TextField()
def __str__(self):
return self.name
class album(models.Model): class Album(models.Model):
id = models.AutoField(primary_key=True) id = models.AutoField(primary_key=True)
album_name = models.CharField(max_length=64) album_name = models.CharField(max_length=64)
year = models.DecimalField(max_digits=4, decimal_places=0) year = models.DecimalField(max_digits=4, decimal_places=0)
artist = models.ForeignKey(artist) artist = models.ForeignKey(Artist)
def __str__(self):
return self.album_name
class song(models.Model): class Song(models.Model):
id = models.AutoField(primary_key=True) id = models.AutoField(primary_key=True)
song_name = models.TextField() song_name = models.TextField()
genre = models.CharField(max_length=128) genre = models.CharField(max_length=128)
song_length = models.PositiveIntegerField(default=0, null=True) song_length = models.PositiveIntegerField(default=0, null=True)
lyrics = models.TextField(null=True) lyrics = models.TextField(null=True)
artist = models.ForeignKey(artist) artist = models.ForeignKey(Artist)
album = models.ForeignKey(album) album = models.ForeignKey(Album)
def __str__(self):
return self.song_name
class music_playlist(models.Model): class MusicPlaylist(models.Model):
id = models.AutoField(primary_key=True) id = models.AutoField(primary_key=True)
playlist_name = models.CharField(max_length=32) playlist_name = models.CharField(max_length=32)
is_public = models.BooleanField(default=False) is_public = models.BooleanField(default=False)
user = models.ForeignKey(user_account) user = models.ForeignKey(UserAccount)
def __str__(self):
return self.playlist_name
class music_entry(models.Model): class MusicEntry(models.Model):
RATING_CHOICES = ( RATING_CHOICES = (
(0,'1'), (0,'1'),
(1,'2'), (1,'2'),
...@@ -48,10 +56,12 @@ class music_entry(models.Model): ...@@ -48,10 +56,12 @@ class music_entry(models.Model):
id = models.AutoField(primary_key=True) id = models.AutoField(primary_key=True)
order_in_playlist = models.PositiveSmallIntegerField() order_in_playlist = models.PositiveSmallIntegerField()
rating = models.DecimalField(max_digits=1, decimal_places=0, choices=RATING_CHOICES) rating = models.DecimalField(max_digits=1, decimal_places=0, choices=RATING_CHOICES)
playlist = models.ForeignKey(music_playlist) playlist = models.ForeignKey(MusicPlaylist)
song = models.ForeignKey(song) song = models.ForeignKey(Song)
class tag(models.Model): class Tag(models.Model):
id = models.AutoField(primary_key=True) id = models.AutoField(primary_key=True)
name = models.CharField(max_length=32) name = models.CharField(max_length=32)
tag = models.ManyToManyField(music_entry) tag = models.ManyToManyField(MusicEntry)
def __str__(self):
return self.name
...@@ -113,6 +113,17 @@ li.dropdown { ...@@ -113,6 +113,17 @@ li.dropdown {
background-color: rgba(20,100,100,0.3); background-color: rgba(20,100,100,0.3);
border-radius: 10px; border-radius: 10px;
padding: 3vw; padding: 3vw;
text-align:center;
}
.features{
background-color: rgba(0,0,0,0.6);
border-radius: 10px;
padding: 3vw;
max-width: 600px
width:100px;
text-align:center;
border: 1px solid #000;
} }
/* Nav bar */ /* Nav bar */
...@@ -191,7 +202,6 @@ a, .link{ ...@@ -191,7 +202,6 @@ a, .link{
#first_name_id{ #first_name_id{
font-size: 100px; font-size: 100px;
} }
......
...@@ -6,21 +6,35 @@ ...@@ -6,21 +6,35 @@
<div class="boxified main"> <div class="boxified main">
<h2>What is MyMusicList?</h2> <h2>What is MyMusicList?</h2>
<p> <p>
MyMusicList is the solution to all your music catalog needs. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum finibus magna eros. Nulla non mauris non mi ornare mattis vel vel diam. Suspendisse malesuada lacus at venenatis sollicitudin. Sed et ultrices ex. Praesent feugiat bibendum nibh. Sed commodo elementum turpis. Morbi faucibus nunc sagittis, rutrum nisl quis, fermentum orci.</br></br> <img src="/files/images/logo.jpg" /> </br> </br>
Do you want to see music like you’ve never before? Do you want to make a playlist without it feeling lifeless and a hassle? Do you want to show off your hip-and-cool music with your friends?
MyMusicList is the answer.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce vel tristique risus. Cras molestie pretium urna, a lobortis diam dictum aliquet. Pellentesque non fermentum dolor, sed aliquet dolor. Etiam mauris ex, congue vehicula eleifend vel, hendrerit fermentum velit. In ac tempus justo. Aliquam nec rutrum nibh. Sed pulvinar ex sed ex tincidunt tempor. Praesent tristique semper mauris, vel pretium sapien congue a.</br></br>
Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Mauris suscipit nec velit non egestas. Quisque auctor viverra urna, at euismod turpis ornare id. Aliquam pharetra purus quis dui blandit tincidunt. Quisque massa ligula, malesuada vel leo eu, accumsan vulputate nulla. Integer faucibus malesuada pharetra. Duis varius sapien sit amet justo malesuada fringilla. Integer eget ex sed urna auctor vestibulum. Aliquam sit amet molestie velit, a pretium ligula. Mauris gravida turpis vitae scelerisque finibus.
</p> </p>
</div> </div>
<div class="boxified main"> <div class="features main">
<h2>Features</h2> <h2>Features</h2>
<p> <p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum finibus magna eros. Nulla non mauris non mi ornare mattis vel vel diam. Suspendisse malesuada lacus at venenatis sollicitudin. Sed et ultrices ex. Praesent feugiat bibendum nibh. Sed commodo elementum turpis. Morbi faucibus nunc sagittis, rutrum nisl quis, fermentum orci.</br></br> <div class="img-container">
<img src="/files/images/image2.png" />
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce vel tristique risus. Cras molestie pretium urna, a lobortis diam dictum aliquet. Pellentesque non fermentum dolor, sed aliquet dolor. Etiam mauris ex, congue vehicula eleifend vel, hendrerit fermentum velit. In ac tempus justo. Aliquam nec rutrum nibh. Sed pulvinar ex sed ex tincidunt tempor. Praesent tristique semper mauris, vel pretium sapien congue a.</br></br> <p>
“Playlist Manager”</br>
Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Mauris suscipit nec velit non egestas. Quisque auctor viverra urna, at euismod turpis ornare id. Aliquam pharetra purus quis dui blandit tincidunt. Quisque massa ligula, malesuada vel leo eu, accumsan vulputate nulla. Integer faucibus malesuada pharetra. Duis varius sapien sit amet justo malesuada fringilla. Integer eget ex sed urna auctor vestibulum. Aliquam sit amet molestie velit, a pretium ligula. Mauris gravida turpis vitae scelerisque finibus. MyMusicList features a simplistic playlist manager that is created for the user’s convenience but still allows a lot of features without overwhelming the user. With MyMusicList’s playlist manager, one can manage multiple playlists, organize music entries, and so much more.
</p>
</div>
<div class="img-container">
<img src="/files/images/image3.png" />
<p>“Customizable Tags”</br>
MyMusicList features customizable tags that you can attach to any music entry. It makes making playlists more personal and makes organizing music easier.
</p>
</div>
<div class="img-container">
<img src="/files/images/image4.png" />
<p>“S.S. Integration”</br>
Your MyMusicList account can be integrated with your selected social media accounts, so you can share your playlists with your friends and followers. You don’t have to leave the site to listen to your playlist because MyMusicList is integrated with your preferred music streaming service.
</p>
</div>
</p> </p>
</div> </div>
<div class="boxified main"> <div class="boxified main">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment