-
Notifications
You must be signed in to change notification settings - Fork 0
/
entry.py
43 lines (39 loc) · 1.29 KB
/
entry.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
'''
5th march 2017 sunday
file=entry.py lang=python3.5.2
i have a practical exam tommorrow
'''
# imports
from gi.repository import RB
'''
about
the most important data structure in the database - RhythmDB
the entry RB.RhythmDBEntry represents a single track
each entry has a set of properties with associated values such as
'title', 'artist', 'play count' and so on...
'location' which must be unique among all the entries in the db
attributes
dropcon
the dropbox client and dropbox
'''
class DropboxEntryType(RB.RhythmDBEntryType):
'''attributes'''
client = None
def __init__(self, dropcon=None):
# make it dropbox-music later... Done
RB.RhythmDBEntryType.__init__(self, name='drobox-music')
if dropcon != None:
self.dropcon = dropcon
'''
about
returns a string containing the playback uri for entry
returns null if the entry cannot be played...
'''
def do_get_playback_uri(self, entry):
print("getting the playback uri for dropbox-music entry")
song_path = entry.dup_string(RB.RhythmDBPropType.LOCATION)
uri = self.dropcon.get_song_uri(song_path)
print("uri of the song is... ", uri)
return uri
def do_can_sync_metadata(self, entry):
return True