refactor: consolidate specid <-> filesystem mapping and always use abs paths (#309)

This commit is contained in:
Senan Kelly
2023-04-22 18:23:17 +01:00
committed by GitHub
parent efe72fc447
commit 74de06430a
10 changed files with 232 additions and 173 deletions

View File

@@ -398,6 +398,7 @@ type PodcastEpisode struct {
Filename string
Status PodcastEpisodeStatus
Error string
AbsP string `gorm:"-"` // TODO: not this. instead we need some consistent way to get the AbsPath for both tracks and podcast episodes. or just files in general
}
func (pe *PodcastEpisode) AudioLength() int { return pe.Length }
@@ -423,6 +424,10 @@ func (pe *PodcastEpisode) MIME() string {
return mime.TypeByExtension(filepath.Ext(pe.Filename))
}
func (pe *PodcastEpisode) AbsPath() string {
return pe.AbsP
}
type Bookmark struct {
ID int `gorm:"primary_key"`
User *User