Add download all button and include options to automatically download new episodes
This commit is contained in:
committed by
Senan Kelly
parent
2a11017d54
commit
10fca91785
@@ -81,6 +81,7 @@ func New(path string) (*DB, error) {
|
||||
migrateListenBrainz(),
|
||||
migratePodcast(),
|
||||
migrateBookmarks(),
|
||||
migratePodcastAutoDownload(),
|
||||
))
|
||||
if err = migr.Migrate(); err != nil {
|
||||
return nil, fmt.Errorf("migrating to latest version: %w", err)
|
||||
|
||||
@@ -250,3 +250,15 @@ func migrateBookmarks() gormigrate.Migration {
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func migratePodcastAutoDownload() gormigrate.Migration {
|
||||
return gormigrate.Migration{
|
||||
ID: "202102191448",
|
||||
Migrate: func(tx *gorm.DB) error {
|
||||
return tx.AutoMigrate(
|
||||
Podcast{},
|
||||
).
|
||||
Error
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -290,17 +290,18 @@ type AlbumGenre struct {
|
||||
}
|
||||
|
||||
type Podcast struct {
|
||||
ID int `gorm:"primary_key"`
|
||||
UpdatedAt time.Time
|
||||
ModifiedAt time.Time
|
||||
UserID int `sql:"default: null; type:int REFERENCES users(id) ON DELETE CASCADE"`
|
||||
URL string
|
||||
Title string
|
||||
Description string
|
||||
ImageURL string
|
||||
ImagePath string
|
||||
Error string
|
||||
Episodes []*PodcastEpisode
|
||||
ID int `gorm:"primary_key"`
|
||||
UpdatedAt time.Time
|
||||
ModifiedAt time.Time
|
||||
UserID int `sql:"default: null; type:int REFERENCES users(id) ON DELETE CASCADE"`
|
||||
URL string
|
||||
Title string
|
||||
Description string
|
||||
ImageURL string
|
||||
ImagePath string
|
||||
Error string
|
||||
Episodes []*PodcastEpisode
|
||||
AutoDownload string
|
||||
}
|
||||
|
||||
func (p *Podcast) Fullpath(podcastPath string) string {
|
||||
|
||||
Reference in New Issue
Block a user