-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmanual_test.py
More file actions
60 lines (47 loc) · 1.82 KB
/
manual_test.py
File metadata and controls
60 lines (47 loc) · 1.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
from itertools import count
from playlist import Playlist
from song import Song
fav_playlist = Playlist("Favorites")
pop_playlist = Playlist("Pop")
song1 = Song(1, "Energy Boost", "Beat Master", "Pop", ["energetic", "happy"], 0.9, 0.95, 0.8, 130, 200, "url", "image", "Boost Album", "2023-01-01")
song2 = Song(2, "Feel Light", "Synth Pop", "Pop", ["chill", "happy"], 0.7, 0.6, 0.9, 120, 210, "url", "image", "Dream Pop", "2021-03-15")
jazz_playlist = Playlist("Jazz")
song3 = Song(3, "Chill Vibes", "Lofi Beats", "Jazz", ["chill", "relax"], 0.8, 0.85, 0.9, 110, 190, "url", "image", "Chill Album", "2022-05-10")
pop_playlist.add_song(song1)
pop_playlist.add_song(song2)
jazz_playlist.add_song(song3)
fav_playlist.add_song(song3)
pop_playlist.display()
get_song_count = len(pop_playlist.songs)
print(f"Total songs in {pop_playlist.name} playlist: {get_song_count}")
jazz_playlist.display()
get_song_count = len(jazz_playlist.songs)
print(f"Total songs in {jazz_playlist.name} playlist: {get_song_count}")
from library import Library
from song import Song
my_library = Library()
rock_song = Song(4, "Guitar Storm", "Rock Band", "Rock", ["energetic", "intense"], 0.6, 0.9, 0.7, 140, 240, "url", "image", "Storm Album", "2020-09-10")
classical_song = Song(5, "Moonlight Sonata", "Beethoven", "Classical", ["calm", "sad"], 0.4, 0.3, 0.2, 60, 300, "url", "image", "Piano Classics", "1801-01-01")
my_library.add_song(classical_song)
my_library.add_song(rock_song)
my_library.display_all_playlists()
my_library.playlists["Rock"].sort_by("tempo")
pop_song = Song(
6,
"Dance Floor",
"DJ Pop",
"Pop",
["happy", "energetic"],
0.9,
0.8,
0.85,
130,
200,
"url",
"image",
"Pop Hits",
"2023-05-05"
)
my_library.add_song(pop_song)
my_library.playlists["Pop"].sort_by_mood("happy")
my_library.display_all_playlists()