refactor: removed unused code, unnecessary typecasts and fixed small warnings

This commit is contained in:
Deluan
2020-03-20 00:02:31 -04:00
parent 270b0ae74e
commit f6e448c1ba
10 changed files with 8 additions and 162 deletions
-5
View File
@@ -3,7 +3,6 @@ package persistence
import (
"context"
"reflect"
"sync"
"github.com/astaxie/beego/orm"
"github.com/deluan/navidrome/db"
@@ -11,10 +10,6 @@ import (
"github.com/deluan/navidrome/model"
)
var (
once sync.Once
)
type SQLStore struct {
orm orm.Ormer
}
+1 -1
View File
@@ -71,7 +71,7 @@ func (r *playlistRepository) GetWithTracks(id string) (*model.Playlist, error) {
continue
}
pls.Duration += mf.Duration
newTracks = append(newTracks, model.MediaFile(*mf))
newTracks = append(newTracks, *mf)
}
pls.Tracks = newTracks
return pls, err
-5
View File
@@ -8,11 +8,6 @@ import (
"github.com/deluan/navidrome/model"
)
type property struct {
ID string `orm:"pk;column(id)"`
Value string
}
type propertyRepository struct {
sqlRepository
}
-12
View File
@@ -10,18 +10,6 @@ import (
"github.com/google/uuid"
)
type annotation struct {
AnnID string `json:"annID" orm:"pk;column(ann_id)"`
UserID string `json:"userID" orm:"pk;column(user_id)"`
ItemID string `json:"itemID" orm:"pk;column(item_id)"`
ItemType string `json:"itemType"`
PlayCount int `json:"playCount"`
PlayDate time.Time `json:"playDate"`
Rating int `json:"rating"`
Starred bool `json:"starred"`
StarredAt time.Time `json:"starredAt"`
}
const annotationTable = "annotation"
func (r sqlRepository) newSelectWithAnnotation(idField string, options ...model.QueryOptions) SelectBuilder {