From 22d16693f3636ec5ff9c1e4db09b33529058f7b3 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Thu, 17 Sep 2020 21:09:10 -0700 Subject: [PATCH] Remove path parameter from get_album, remove get_album_by_id. First of all, I realized the return statement was using the outdated singular name of the method. But anyway, I don't like the idea that this method would sometimes return a single album by id or a list of albums by path. If you want to get by path, use get_albums_by_path explicitly. --- etiquette/photodb.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/etiquette/photodb.py b/etiquette/photodb.py index 343c6ec..6bd20fa 100644 --- a/etiquette/photodb.py +++ b/etiquette/photodb.py @@ -33,16 +33,7 @@ class PDBAlbumMixin: def __init__(self): super().__init__() - def get_album(self, id=None, path=None): - if not helpers.is_xor(id, path): - raise exceptions.NotExclusive(['id', 'path']) - - if id is not None: - return self.get_album_by_id(id) - else: - return self.get_album_by_path(path) - - def get_album_by_id(self, id): + def get_album(self, id): return self.get_thing_by_id('album', id) def get_album_count(self):