diff --git a/db/db.go b/db/db.go index 0ebc620..fc392f3 100644 --- a/db/db.go +++ b/db/db.go @@ -390,11 +390,13 @@ type WebdavSetting struct { } func (c *client) AddStorage(st *StorageInfo) error { - if !strings.HasSuffix(st.TvPath, "/") { - st.TvPath += "/" - } - if !strings.HasSuffix(st.MoviePath, "/") { - st.MoviePath += "/" + if st.Implementation != storage.ImplementationLocal.String() { //add seperator if not local storage + if !strings.HasSuffix(st.TvPath, "/") { + st.TvPath += "/" + } + if !strings.HasSuffix(st.MoviePath, "/") { + st.MoviePath += "/" + } } if st.Settings == nil { st.Settings = map[string]string{} diff --git a/server/storage.go b/server/storage.go index 0f6fc12..6a0e96b 100644 --- a/server/storage.go +++ b/server/storage.go @@ -4,6 +4,7 @@ import ( "fmt" "os" "polaris/db" + "strings" "polaris/log" "polaris/pkg/alist" @@ -52,10 +53,17 @@ func (s *Server) AddStorage(c *gin.Context) (interface{}, error) { if err != nil { return nil, err } + if !strings.HasSuffix(in.TvPath, string(os.PathSeparator)) { + in.TvPath = in.TvPath + string(os.PathSeparator) + } _, err = os.Stat(in.MoviePath) if err != nil { return nil, err } + if !strings.HasSuffix(in.MoviePath, string(os.PathSeparator)) { + in.MoviePath = in.MoviePath + string(os.PathSeparator) + } + } log.Infof("received add storage input: %v", in) err := s.db.AddStorage(&in) diff --git a/ui/lib/providers/APIs.dart b/ui/lib/providers/APIs.dart index f75cd91..aafd624 100644 --- a/ui/lib/providers/APIs.dart +++ b/ui/lib/providers/APIs.dart @@ -20,7 +20,7 @@ class APIs { //static final singleSettingUrl = "$_baseUrl/api/v1/setting/"; static final watchlistTvUrl = "$_baseUrl/api/v1/media/tv/watchlist"; static final watchlistMovieUrl = "$_baseUrl/api/v1/media/movie/watchlist"; - static final availableTorrentsUrl = "$_baseUrl/api/v1/media/torrents/"; + static final availableTorrentsUrl = "$_baseUrl/api/v1/media/torrents"; static final downloadTorrentUrl = "$_baseUrl/api/v1/media/torrents/download"; static final seriesDetailUrl = "$_baseUrl/api/v1/media/record/"; static final suggestedTvName = "$_baseUrl/api/v1/media/suggest/tv/"; @@ -83,6 +83,7 @@ class APIs { static Dio getDio() { var dio = Dio(); + dio.options.followRedirects = true; dio.interceptors.add(InterceptorsWrapper( onError: (error, handler) { if (error.response?.statusCode != null && diff --git a/ui/lib/providers/series_details.dart b/ui/lib/providers/series_details.dart index 17f1acd..8b9b354 100644 --- a/ui/lib/providers/series_details.dart +++ b/ui/lib/providers/series_details.dart @@ -281,8 +281,8 @@ class TorrentResource { String? link; String? source; int? indexerId; - double? downloadFactor; - double? uploadFactor; + num? downloadFactor; + num? uploadFactor; bool? isPrivate; factory TorrentResource.fromJson(Map json) {