forked from plamere/SmarterPlaylists
-
Notifications
You must be signed in to change notification settings - Fork 0
/
components.py
2150 lines (2022 loc) · 82.6 KB
/
components.py
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import pbl
import plugs
import copy
import pyen
import datetime
import mixer
exported_inventory = None
en = pyen.Pyen()
en.debug=True
genres_enabled = False
inventory = {
"types" : {
"day_of_week": [
{ "name": "Monday", "value": 0 },
{ "name": "Tuesday", "value": 1 },
{ "name": "Wednesday", "value": 2 },
{ "name": "Thursday", "value": 3 },
{ "name": "Friday", "value": 4 },
{ "name": "Saturday", "value": 5 },
{ "name": "Sunday", "value": 6 }
],
"color": [
{ "name": "black", "value": "#000000" },
{ "name": "red", "value": "#ff0000" },
{ "name": "green", "value": "#00ff00" },
{ "name": "blue", "value": "#0000ff" },
],
"annotations": [
{ "name" : "Spotify", "value" : "spotify" },
{ "name" : "Echo Nest", "value" : "echonest" },
{ "name" : "audio", "value" : "audio" }
],
"playlist_suffix": [
{ "name" : "none", "value" : "none" },
{ "name" : "time", "value" : "time" },
{ "name" : "date", "value" : "date" },
{ "name" : "day-of-week", "value" : "day-of-week" },
{ "name" : "day-of-month", "value" : "day-of-month" }
],
"scale": [
{ "name" : "most", "value" : 0 },
{ "name" : "more", "value" : 1 },
{ "name" : "less", "value" : 2 },
{ "name" : "least", "value" : 3 },
{ "name" : "all", "value" : 4 },
],
"time_range": [
{ "name": "short term", "value": "short_term" },
{ "name": "medium term", "value": "medium_term" },
{ "name": "long term", "value": "long_term" }
],
"range_attributes" : [
{
"name" : "artist popularity",
"value" : "spotify.primary_artist_popularity",
"min_value": 0,
"max_value": 100,
"description": """ A normalized estimation of how popular the
primary artist of a track is based on recent streaming."""
},
{
"name" : "artist followers",
"value" : "spotify.primary_artist_followers",
"min_value" : 0,
"description": """ The current number of followers for the
primary artist of the track."""
},
{
"name" : "album popularity",
"value" : "spotify.album_popularity",
"min_value": 0,
"max_value": 100,
"description": """ A normalized estimation of how popular the
album of a track is based on recent streaming."""
},
{
"name" : "track popularity",
"value" : "spotify.popularity",
"min_value": 0,
"max_value": 100,
"description": """ A normalized estimation of how popular the
track is based on recent streaming."""
},
{
"name" : "speechiness",
"value" : "audio.speechiness",
"min_value": 0,
"max_value": 1,
"description": """Estimates the amount of spoken word in a
track. The more exclusively speech-like the track (e.g. talk
show, audio book, poetry), the closer to 1.0 the attribute
value. Values above 0.66 describe tracks that are probably made
entirely of spoken words. Values between 0.33 and 0.66 describe
tracks that may contain both music and speech, either in
sections or layered, including such cases as rap music. Values
below 0.33 most likely represent music and other non-speech-like
tracks."""
},
{
"name" : "acousticness",
"value" : "audio.acousticness",
"min_value": 0,
"max_value": 1,
"description": """Estimates the likelihood a recording was
created by solely acoustic means such as voice and acoustic
instruments as opposed to electronically such as with
synthesized, amplified, or effected instruments. Tracks with low
acousticness include electric guitars, distortion, synthesizers,
auto-tuned vocals, and drum machines, whereas songs with
orchestral instruments, acoustic guitars, unaltered voice, and
natural drum kits will have acousticness values closer to
1.0."""
},
{
"name" : "danceability",
"value" : "audio.danceability",
"min_value": 0,
"max_value": 1,
"description": """Describes how suitable a track is for dancing
using a number of musical elements (the more suitable for
dancing, the closer to 1.0 the value). The combination of
musical elements that best characterize danceability include
tempo, rhythm stability, beat strength, and overall
regularity."""
},
{
"name" : "energy",
"value" : "audio.energy",
"min_value": 0,
"max_value": 1,
"description": """Represents a perceptual measure of intensity
and powerful activity released throughout the track. Typical
energetic tracks feel fast, loud, and noisy. For example, death
metal has high energy, while a Bach prelude scores low on the
scale. Perceptual features contributing to this attribute
include dynamic range, perceived loudness, timbre, onset rate,
and general entropy."""
},
{
"name" : "tempo",
"value" : "audio.tempo",
"min_value": 30,
"max_value": 300,
"description": """The overall estimated tempo of a track in
beats per minute (BPM). In musical terminology, tempo is the
speed or pace of a given piece and derives directly from the
average beat duration. """
},
{
"name" : "instrumentalness",
"value" : "audio.instrumentalness",
"min_value": 0,
"max_value": 1,
"description": """Predicts whether a track contains no vocals.
"Ooh" and "aah" sounds are treated as instrumental in this
context. Rap or spoken word tracks are clearly "vocal". The
closer the instrumentalness value is to 1.0, the greater
likelihood the track contains no vocal content. Values above 0.5
are intended to represent instrumental tracks, but confidence is
higher as the value approaches 1.0."""
},
{
"name" : "key",
"value" : "audio.key",
"min_value": 0,
"max_value": 12,
"description": """The key the track is in. Integers map to
pitches using standard Pitch Class notation. E.g. 0 = C, 1 =
C#, 2 = D, and so on."""
},
{
"name" : "liveness",
"value" : "audio.liveness",
"min_value": 0,
"max_value": 1,
"description": """ Detects the presence of an audience in the
recording. The more confident that the track is live, the closer
to 1.0 the attribute value. A value above 0.8 provides strong
likelihood that the track is live."""
},
{
"name" : "mode",
"value" : "audio.mode",
"min_value": 0,
"max_value": 1,
"description": """Indicates the modality (major or minor)
of a track, the type of scale from which its melodic content is
derived. Major is represented by 1 and minor is 0."""
},
{
"name" : "time signature",
"value" : "audio.time_signature",
"min_value": 1,
"max_value": 10,
"description": """Estimates of the overall time signature of a
track. The time signature (meter) is a notational convention to
specify how many beats are in each bar (or measure)."""
},
{
"name" : "loudness",
"value" : "audio.loudness",
"min_value": -60,
"max_value": 5, "description": """The overall loudness of a track in decibels (dB).
Loudness values are averaged across the entire track and are
useful for comparing relative loudness of tracks. Loudness is
the quality of a sound that is the primary psychological
correlate of physical strength (amplitude)."""
},
{
"name" : "valence",
"value" : "audio.valence",
"min_value": 0,
"max_value": 1,
"description": """A measure from 0.0 to 1.0 describing the
musical "positiveness" conveyed by a track. Tracks with high
valence sound more positive (e.g., happy, cheerful, euphoric),
while tracks with low valence sound more negative (e.g. sad,
depressed, angry)."""
},
{
"name" : "duration",
"value" : "duration",
"min_value": 0,
"max_value": 10000,
"description": "The duration of the track, in seconds"
},
{
"name" : "popularity",
"value" : "spotify.popularity",
"min_value": 0,
"max_value": 100,
"description": """A normalized estimation of how popular the
track is based on recent streaming."""
},
{
"name" : "track number",
"value" : "spotify.track_number",
"min_value": 0,
"max_value": 100,
"description": """The position of the track on its album. If an
album has several discs, the track number is the number on the specified
disc."""
},
{
"name" : "disc number",
"value" : "spotify.disc_number",
"min_value": 1,
"max_value": 100,
"description": """The disc number (usually 1 unless the album
consists of more than one disc)."""
}
],
"sort_attributes" : [
{ "name" : "artist popularity", "value" : "spotify.primary_artist_popularity"},
{ "name" : "artist followers", "value" : "spotify.primary_artist_followers"},
{ "name" : "album popularity", "value" : "spotify.album_popularity"},
{ "name" : "album date", "value" : "spotify.album_release_date"},
{ "name" : "track popularity", "value" : "spotify.popularity"},
{ "name" : "speechiness", "value" : "audio.speechiness"},
{ "name" : "acousticness", "value" : "audio.acousticness"},
{ "name" : "danceability", "value" : "audio.danceability"},
{ "name" : "energy", "value" : "audio.energy"},
{ "name" : "tempo", "value" : "audio.tempo"},
{ "name" : "instrumentalness", "value" : "audio.instrumentalness"},
{ "name" : "key", "value" : "audio.key"},
{ "name" : "liveness", "value" : "audio.liveness"},
{ "name" : "mode", "value" : "audio.mode"},
{ "name" : "time signature", "value" : "audio.time_signature"},
{ "name" : "loudness", "value" : "audio.loudness"},
{ "name" : "valence", "value" : "audio.valence"},
{ "name" : "artist name ", "value" : "artist"},
{ "name" : "title", "value" : "title"},
{ "name" : "src", "value" : "src"},
{ "name" : "duration", "value" : "duration"},
{ "name" : "artist", "value" : "artist"},
{ "name" : "title", "value" : "title"},
{ "name" : "popularity", "value" : "spotify.popularity"},
{ "name" : "explicit", "value" : "spotify.explicit"},
{ "name" : "track number", "value" : "spotify.track_number"},
{ "name" : "disc number", "value" : "spotify.disc_number"}
# TODO - get rid of echonest stuff, add full album attributes, to
# get the release date, album type, genre and so on
# add full artist attributes to get artist popularity, genres
#
]
},
"components" : [
{
"name" : "Annotator",
"display": "annotate",
"class": pbl.Annotator,
"type" : "combiner",
"description": "Annotates tracks with external information",
"help" : """This component will add information to the tracks on the
input stream. This can make downstream operations like range filters
run much faster. Supported annotation types are <i>echonest</i>,
<i>audio</i> and <i>spotify</i>""",
"title" : "annotate with $type data",
"params": {
"source": {
"type" : "port",
"optional" : False,
"port": "green",
"max_inputs": 1,
"description": "the source of the tracks",
},
"type": {
"type" : "annotations",
"optional" : False,
"default" : "audio",
"description": "the type of annotation",
},
}
},
{
"name" : "DeDup",
"display": "de-dup",
"class": pbl.DeDup,
"type" : "filter",
"description": "Remove any duplicate tracks in the stream",
"help" : """ This component will remove any duplicate tracks from
the stream.
If <b> By Name </b> is set, then tracks dedupped by
artist and title, otherwise, they are dedupped based upon their
track id""",
"params": {
"source": {
"type" : "port",
"optional" : False,
"port": "green",
"max_inputs": 1,
"description": "the source of the tracks",
},
"by_name": {
"display" : "By name",
"type" : "bool",
"optional" : True,
"default": False,
"description": " if True also match by name in addition to the regular ID match",
},
}
},
{
"name" : "ArtistDeDup",
"display": "artist de-dup",
"class": plugs.ArtistDeDup,
"type" : "filter",
"description": "Ensure only unique artists appear in the track stream",
"help" : """ This component will remove any tracks with duplicate
artists from the stream. """,
"params": {
"source": {
"type" : "port",
"optional" : False,
"port": "green",
"max_inputs": 1,
"description": "the source of the tracks",
},
}
},
{
"name" : "ArtistSeparation",
"display": "artist separation",
"class": plugs.ArtistSeparation,
"type" : "filter",
"description": "Enforces a specified separation of artists in the track stream",
"help" : """ This component will guarantee that artists will not
appear closer together than the given <b>minimum artist separation</b> in the
track stream. If <b>reorder</b> is set, then tracks may be reordered
to enforce the separation, otherwise, if <b>reorder</b> is not set,
then offending tracks are removed from the stream.""",
"params": {
"source": {
"type" : "port",
"optional" : False,
"port": "green",
"max_inputs": 1,
"description": "the source of the tracks",
},
"min_separation": {
"type" : "number",
"optional" : True,
"default" : 4,
"display" : "minimum artist separation",
"description": "minimum number of tracks between tracks by the same artist"
},
"reorder": {
"type" : "bool",
"optional" : True,
"default" : True,
"display": "reorder",
"description": "if true, tracks may be reordered to enforce artist separation, otherwise, offending tracks are simply omitted from the stream",
},
}
},
{
"name" : "comment",
"display": "comment",
"class": plugs.Comment,
"type" : "misc",
"title": "$text",
"description": "Add a comment to the program",
"help" : """This component lets you add arbitrary comments to your
program. Comments have no effect on how a program will execute""",
"max_outputs": 0,
"params": {
"text": {
"type" : "string",
"optional" : True,
"description": "the text for the comment",
}
}
},
{
"name" : "TrackFilter",
"class": plugs.TrackFilter,
"display": "track filter",
"type" : "filter",
"description": "removes track from a stream",
"help": """ This component takes two input streams. It produces a
stream of tracks from the green input
stream with the tracks on the red input stream removed. If the
<b>invert</b> flag is set, the filter is inverted, that is, it will
produce a stream of tracks that consist of the tracks on the green
input stream with the tracks that are <b> not </b> on the red
stream.
If <b> By Name </b> is set, then tracks are matched by name in
addition to the regular ID match
""",
"params": {
"true_source": {
"type" : "port",
"optional" : False,
"port": "green",
"max_inputs" : 1,
"description": "the source of tracks",
},
"false_source": {
"type" : "port",
"optional" : False,
"port": "red",
"max_inputs" : 1,
"description": "the tracks to be removed",
},
"invert": {
"type": "bool",
"default": False,
"optional" : True,
"description": "if set, only tracks on both input streams will be passed through"
},
"by_name": {
"display" : "By name",
"type" : "bool",
"optional" : True,
"default": False,
"description": " if True also match by name in addition to the regular ID match",
},
}
},
{
"name" : "ArtistFilter",
"class": plugs.ArtistFilter,
"display": "artist filter",
"type" : "filter",
"description": "removes track from a stream by artist",
"help": """ This component takes two input streams. It produces a
stream of tracks that consist of the tracks on the green input
stream with the tracks by artists of the tracks on the red input
stream removed. If the <b>invert</b> parameter is set, the sense of
the filter is reverse, i.e. the component will produce only tracks
from the green stream that are by artists on the red stream """,
"params": {
"true_source": {
"type" : "port",
"optional" : False,
"port": "green",
"max_inputs" : 1,
"description": "the source of tracks",
},
"false_source": {
"type" : "port",
"optional" : False,
"port": "red",
"max_inputs" : 1,
"description": "the tracks (by artist) to be removed",
},
"invert": {
"type": "bool",
"default": False,
"optional" : True,
"description": "if set, only tracks by artists on the red stream will be passed through"
},
}
},
{
"name" : "YesNo",
"class": plugs.YesNo,
"display": "yes or no",
"type" : "conditional",
"description": "selects a stream based on a boolean",
"help": """ This component excepts a red and a green input stream.
If the <b> yes </b> parameter is set, tracks from the green stream
will be passed through, otherwise, tracks from the red stream will
be passed through""",
"params": {
"true_source": {
"type" : "port",
"optional" : False,
"port": "green",
"max_inputs" : 1,
"description": "the source of tracks when yes",
},
"false_source": {
"type" : "port",
"optional" : False,
"port": "red",
"max_inputs" : 1,
"description": "the source of tracks when no",
},
"yes": {
"type" : "bool",
"optional" : False,
"description": "if true chose the yes stream",
},
}
},
{
"name" : "IsWeekend",
"class": plugs.IsWeekend,
"display": "is weekend",
"type" : "conditional",
"description": "selects a stream based on whether or not today is a weekend",
"help" : """This component accepts a green and a red stream. If the
current day is a weekend, tracks from the green stream are passed
through, otherwise tracks from the red stream are passed
through.""",
"params": {
"true_source": {
"type" : "port",
"optional" : False,
"port": "green",
"max_inputs" : 1,
"description": "the source of tracks when it is a weekend",
},
"false_source": {
"type" : "port",
"optional" : False,
"port": "red",
"max_inputs" : 1,
"description": "the source of tracks when it is not a weekend",
},
}
},
{
"name" : "IsDayOfWeek",
"class": plugs.IsDayOfWeek,
"type" : "conditional",
"display": "is day of week",
"title": "is $day",
"description": "selects a stream based on whether is is the given day of the week",
"help" : """This component accepts a green and a red stream. If the
current day matches the day specified, tracks from the green stream are passed
through, otherwise tracks from the red stream are passed
through.""",
"params": {
"true_source": {
"type" : "port",
"optional" : False,
"port": "green",
"max_inputs" : 1,
"description": "the source of tracks when the day matches",
},
"false_source": {
"type" : "port",
"optional" : False,
"port": "red",
"max_inputs" : 1,
"description": "the source of tracks when the day doesn't match",
},
"day": {
"type" : "day_of_week",
"stype" : "number",
"optional" : False,
"description": "the day of the week",
},
}
},
{
"name" : "AlbumSource",
"class": pbl.AlbumSource,
"display": "album",
"type" : "source",
"description": "generates a series of tracks given an album",
"help" : """ If an album <b> uri </b> is specified, the tracks from
that album are generated, otherwise tracks from the album with the given
<b>artist</b> and <b>title</b> are generated""",
"title": "$title",
"params": {
"title": {
"type" : "string",
"optional" : True,
"description": "the title of the album",
},
"artist": {
"type" : "string",
"optional" : True,
"description": "the name of the artist",
},
"uri": {
"type" : "uri",
"optional" : True,
"description": "the uri of the artist",
},
}
},
{
"name" : "TrackSource",
"class": pbl.TrackSource,
"display": "track uris",
"type" : "source",
"description": "generates a series of tracks given their URIs",
"help": """ This component generates a series of one or more tracks
given their URIs. You specify the URIs as a comma separated list of
tracks like so: <pre> spotify:track:69JnEQF6OCntGndij5BTlq,
spotify:track:00t1USAjV7tiTDwlN6U44I </pre>.""",
"params": {
"uris": {
"type" : "uri_list",
"optional" : False,
"description": "a list of track uris",
},
}
},
{
"name" : "TrackSourceByName",
"class": pbl.TrackSourceByName,
"description": "generates a single track given its name",
"help": """ This component will search for the most popular track
with the given title and artist.""",
"display": "track",
"type" : "source",
"title" : "$title",
"params": {
"title": {
"type" : "string",
"optional" : False,
"description": "the title and artist of the track",
},
}
},
{
"name" : "SimpleArtistFilter",
"class": pbl.ArtistFilter,
"type" : "filter",
"display": "simple artist filter",
"description": "removes tracks by the given artist",
"help" : """ This component will remove tracks from the input stream
that are by the given set of artists. Artists are specified as a
list of comma separated name.""",
"params": {
"source": {
"type" : "port",
"optional" : False,
"port": "green",
"max_inputs": 1,
"description": "the source of the tracks",
},
"artistNames": {
"type" : "string_list",
"display" : "Artist name(s)",
"optional" : False,
"description": "a list of artist names",
},
}
},
{
"name" : "ArtistTopTracks",
"class": pbl.ArtistTopTracks,
"type" : "source",
"display": "artist top tracks",
"description": "generates a series of top tracks by the given artist",
"title" : "Top $name tracks",
"help" : """ This component will generate the top 10 tracks for the
given artist. You can specify the artist either by name or by URI.
If both are given, the URI is used.""",
"params": {
"name": {
"type" : "string",
"optional" : True,
"description": "the name of the artist",
},
"uri": {
"type" : "uri",
"optional" : True,
"description": "the uri of the artist",
},
}
},
{
"name" : "EchoNestGenreRadio",
"class": pbl.EchoNestGenreRadio,
"type" : "source",
'disabled': True,
"display": "genre radio",
"description": "generates a series of tracks in the given genre",
"help": """ This component will generate a stream of tracks given
the Echo Nest genre. You can chose from a wide range of genres. Use
<b> count </b> to control how many tracks are returned""",
"title" : "$genre",
"params": {
"genre": {
"type" : "genre",
"stype" : "string",
"optional" : False,
"default": "emo",
"description": "the genre of interest",
},
"count": {
"type" : "number",
"optional" : True,
"default" : 20,
"description": "The number of tracks to generate",
},
}
},
{
"name" : "EchoNestArtistRadio",
"class": pbl.EchoNestArtistRadio,
'disabled': True,
"type" : "source",
"display": "artist radio",
"description": "tracks by the given artist and similar artists",
"help" : """ This component generates a stream of tracks by the
given artist or similar artists. The <b>count</b> controls how many
tracks are generated.""",
"title" : "$artist radio",
"params": {
"seed_artist_name_or_uri": {
"display" : "artist",
"type" : "string",
"optional" : False,
"description": "the seed artist",
},
"count": {
"type" : "number",
"optional" : True,
"default" : 20,
"description": "The number of tracks to generate",
},
}
},
{
"name" : "SpotifyArtistRadio",
"class": plugs.SpotifyArtistRadio,
"type" : "source",
"display": "artist radio",
"description": "tracks by the given artist and similar artists",
"help" : """ This component generates a stream of tracks by the
given artist or similar artists """,
"title" : "$seed_artist_name_or_uri radio",
"params": {
"seed_artist_name_or_uri": {
"display" : "artist",
"type" : "string",
"optional" : False,
"description": "the seed artist (as a name or artist uri)",
},
}
},
{
"name" : "EchoNestArtist",
"class": pbl.EchoNestArtistPlaylist,
"type" : "source",
'disabled': True,
"display": "artist tracks",
"description": "tracks by the given artist",
"help" : """ This component generates a stream of tracks by the
given artist. The <b>count</b> controls how many tracks are generated.
The tracks returned will vary from run to run. More popular tracks
by the artist are favored.""",
"title" : "$artist",
"params": {
"artist": {
"type" : "string",
"optional" : False,
"description": "the seed artist",
},
"count": {
"type" : "number",
"optional" : True,
"default" : 20,
"description": "The number of tracks to generate",
},
}
},
{
"name" : "SpotifyPlaylist",
"class": pbl.PlaylistSource,
"type" : "source",
"display": "playlist",
"description": "loads tracks from the given spotify playlist",
"help" : """ This component will generate a stream of tracks from the given Spotify
playlist. If you specify a Spotify playlist <b>URI</b>, that playlist will
be loaded. If you omit the URI but specify a <b>user</b> and a
<b>name</b>, the user's public playlists will be searched for the playlist with the
given name. If no user is specified, the most popular playlist with
the given <b>name</b> will be used.
""",
"title": "$name",
"params": {
"name": {
"type" : "string",
"optional" : False,
"description": "the name of the playlist",
"default" : "Your favorite coffeehouse"
},
"user": {
"type" : "string",
"optional" : True,
"description": "the owner of the playlist",
},
"uri": {
"type" : "string",
"optional" : True,
"description": "the uri of the playlist",
},
}
},
{
"name" : "RelativeDatedSpotifyPlaylist",
"class": plugs.RelativeDatedPlaylistSource,
"type" : "source",
"display": "playlist (rel date)",
"description": "loads tracks from the given spotify playlist, potentially ordered and filtered by the relative track added date",
"help" : """ This component will generate a stream of tracks from the given Spotify
playlist. If you specify a Spotify playlist <b>URI</b>, that playlist will
be loaded. If you omit the URI but specify a <b>user</b> and a
<b>name</b>, the user's public playlists will be searched for the playlist with the
given name. If no user is specified, the most popular playlist with
the given <b>name</b> will be used.
<p>
By default tracks are generated in playlist order. If <b>Order by
date added</b> is set, tracks are returned in order of the date they
were added to the playlist.
<p>
By setting relative dates <b>tracks added before</b> and/or <b> tracks added since</b>
you can restrict tracks generated to just those that were added in
the given period.
<p> Examples of relative dates:
<ul>
<li> 5 days
<li> 1 year, 2 months and 3 days
<li> last week
<li> two weeks ago
</ul>
More examples can be found on the <a href="about.html"> about
page</a>
""",
"title": "$name",
"params": {
"name": {
"type" : "string",
"optional" : False,
"description": "the name of the playlist",
"default" : "Your favorite coffeehouse"
},
"user": {
"type" : "string",
"optional" : True,
"description": "the owner of the playlist",
},
"uri": {
"type" : "string",
"optional" : True,
"description": "the uri of the playlist",
},
"order_by_date_added": {
"type" : "bool",
"optional" : True,
"default" : False,
"display": "Order by date added",
"description": "if true, tracks are ordered by the date added to the playlist",
},
"tracks_added_since": {
"type" : "string",
"display": "Include only tracks added since",
"optional" : True,
"default" : "",
"description": "If set, only tracks added since this relative date are generated",
},
"tracks_added_before": {
"type" : "string",
"display": "Include only tracks added before",
"optional" : True,
"default" : "",
"description": "If set, only tracks added before this relative date are generated",
},
}
},
{
"name" : "DatedSpotifyPlaylist",
"class": plugs.DatedPlaylistSource,
"type" : "source",
"display": "playlist (abs date)",
"description": "loads tracks from the given spotify playlist, potentially ordered and filtered by the absolute track added date",
"help" : """ This component will generate a stream of tracks from the given Spotify
playlist. If you specify a Spotify playlist <b>URI</b>, that playlist will
be loaded. If you omit the URI but specify a <b>user</b> and a
<b>name</b>, the user's public playlists will be searched for the playlist with the
given name. If no user is specified, the most popular playlist with
the given <b>name</b> will be used.
<p>
By default tracks are generated in playlist order. If <b>Order by
date added</b> is set, tracks are returned in order of the date they
were added to the playlist.
<p>
By setting <b>tracks added before</b> and/or <b> tracks added since</b>
you can restrict tracks generated to just those that were added in
the given period.
""",
"title": "$name",
"params": {
"name": {
"type" : "string",
"optional" : False,
"description": "the name of the playlist",
"default" : "Your favorite coffeehouse"
},
"user": {
"type" : "string",
"optional" : True,
"description": "the owner of the playlist",
},
"uri": {
"type" : "string",
"optional" : True,
"description": "the uri of the playlist",
},
"order_by_date_added": {
"type" : "bool",
"optional" : True,
"default" : False,
"display": "Order by date added",
"description": "if true, tracks are ordered by the date added to the playlist",
},
"tracks_added_since": {
"type" : "optional_date",
"display": "Include only tracks added since",
"optional" : True,
"default" : -1,
"description": "If set, only tracks added since this date are generated",
},
"tracks_added_before": {
"type" : "optional_date",
"display": "Include only tracks added before",