Skip to content
This repository has been archived by the owner on May 3, 2020. It is now read-only.

Commit

Permalink
Revert "Merge pull request #7 from jtan189/master"
Browse files Browse the repository at this point in the history
This reverts commit 8f38dcf, reversing
changes made to 1f3c950.
  • Loading branch information
twaddington committed May 30, 2015
1 parent 8f38dcf commit 1271715
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 26 deletions.
24 changes: 0 additions & 24 deletions bin/rdio-export
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ def main():
help='the email of the Rdio user to fetch')
parser.add_argument('-u', '--username',
help='the username of the Rdio user to fetch')
parser.add_argument('-l', '--level',
choices=['album', 'artist', 'track'],
default='album',
help='level of detail with which to report collection')
parser.add_argument('--quiet', action='store_true',
help='suppress all output except errors')
parser.add_argument('--version', action='version',
Expand All @@ -52,10 +48,6 @@ def main():
global quiet
quiet = args.quiet

# initialize rdio key and secret
rdio_consumer_key = None
rdio_consumer_secret = None

# Load authentication from global config
config = ConfigParser()
config.read(os.path.join(os.path.expanduser('~'), '.rdioconfig'))
Expand Down Expand Up @@ -100,10 +92,8 @@ def main():

# Iterate over the user's collection, grouped by artist
last_artist = None
last_album = None
for t in exporter.collection(user):
artist = t.get('artist')
album = t.get('album')

# Group by artist
if artist != last_artist:
Expand All @@ -112,20 +102,6 @@ def main():
# Update the last artist
last_artist = artist

if args.level == 'artist':
continue

# Group by album
if album != last_album:

uprint("\n### %s" % album)

# Update the last album
last_album = album

if args.level == 'album':
continue

uprint(' - %s' % t.get('name'))

if __name__ == '__main__':
Expand Down
3 changes: 1 addition & 2 deletions rdio_export/exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
'artist',
'displayDate',
'shortUrl',
'album',
'albumKey',
'artistKey',
))
Expand Down Expand Up @@ -76,7 +75,7 @@ def collection(self, user, sort=RDIO_C_SORT_BY, count=RDIO_C_PER_PAGE,
# Continue fetching in batches until the last response is smaller
# than the page size (count).
while (resp_size == count):
collection = self._call('collection', 'getTracksInCollection',
collection = self._call('collection', 'getAlbumsInCollection',
user=user.get('key'), sort=sort, start=start, count=count, extras=extras)

# Update the size of the last response
Expand Down

0 comments on commit 1271715

Please sign in to comment.