@ -14,6 +14,10 @@ import variables as var
|
||||
import util
|
||||
|
||||
|
||||
class ItemNotCachedError(Exception):
|
||||
pass
|
||||
|
||||
|
||||
class MusicCache(dict):
|
||||
def __init__(self, db: MusicDatabase):
|
||||
super().__init__()
|
||||
@ -142,7 +146,7 @@ class CachedItemWrapper:
|
||||
if self.id in self.lib:
|
||||
return self.lib[self.id]
|
||||
else:
|
||||
raise ValueError(f"Uncached item of id {self.id}, type {self.type}.")
|
||||
raise ItemNotCachedError(f"Uncached item of id {self.id}, type {self.type}.")
|
||||
|
||||
def to_dict(self):
|
||||
dict = self.item().to_dict()
|
||||
|
Reference in New Issue
Block a user