2022-02-04 13:32:22 +00:00
|
|
|
class Tags:
|
2022-02-04 13:54:10 +00:00
|
|
|
title = ""
|
|
|
|
artist = ""
|
2022-02-04 13:32:22 +00:00
|
|
|
|
2022-02-04 13:54:10 +00:00
|
|
|
def to_dict(self):
|
|
|
|
return {
|
|
|
|
"title": self.title,
|
|
|
|
"artist": self.artist
|
|
|
|
}
|
|
|
|
|
|
|
|
def __repr__(self):
|
|
|
|
return repr(self.to_dict())
|
2022-02-04 13:32:22 +00:00
|
|
|
|
|
|
|
|
|
|
|
class File:
|
2022-02-04 13:54:10 +00:00
|
|
|
filename = ""
|
|
|
|
extension = ""
|
|
|
|
# The path to the actual file
|
|
|
|
path_to = ""
|
|
|
|
# The path relative to the source directory
|
|
|
|
path_from_src = ""
|
|
|
|
|
|
|
|
tags = Tags()
|
|
|
|
|
|
|
|
def join_filename(self):
|
|
|
|
return f"{self.filename}.{self.extension}"
|
|
|
|
|
|
|
|
def join_path_to(self):
|
|
|
|
return f"{self.path_to}/{self.filename}.{self.extension}"
|
|
|
|
|
|
|
|
def join_path_from_src(self):
|
|
|
|
return f"{self.path_from_src}/{self.filename}.{self.extension}"
|
|
|
|
|
|
|
|
def to_dict(self):
|
|
|
|
return {
|
|
|
|
"filename": self.filename,
|
|
|
|
"extension": self.extension,
|
|
|
|
"path_to": self.path_to,
|
|
|
|
"path_from_src": self.path_from_src,
|
|
|
|
"tags": self.tags.to_dict(),
|
|
|
|
}
|
|
|
|
|
|
|
|
def __repr__(self):
|
|
|
|
return repr(self.to_dict())
|