Skip to content

Commit

Permalink
🐛 add local drive model json convert
Browse files Browse the repository at this point in the history
  • Loading branch information
ourfor committed Jan 24, 2025
1 parent 9f60805 commit 512bf6f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
@JsonSubTypes.Type(value = OneDriveModel.class, name = "onedrive"),
@JsonSubTypes.Type(value = Cloud189Model.class, name = "cloud189"),
@JsonSubTypes.Type(value = WebDAVModel.class, name = "webdav"),
@JsonSubTypes.Type(value = AlistDriveModel.class, name = "alist")
@JsonSubTypes.Type(value = AlistDriveModel.class, name = "alist"),
@JsonSubTypes.Type(value = LocalDriveModel.class, name = "local"),
})
public interface Drive {
default ServerType getType() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.CountDownLatch;
Expand Down Expand Up @@ -79,6 +80,7 @@ public class GlobalStore {
public static GlobalStore shared = defaultStore();

public GlobalStore() {
drives = new ArrayList<>();
sites = new ArrayList<>();
dataSource = createDataSource();
}
Expand Down Expand Up @@ -107,6 +109,7 @@ public static GlobalStore defaultStore() {
if (instance.dataSource == null) {
instance.dataSource = createDataSource();
}
instance.drives.removeIf(Objects::isNull);
}
return instance;
}
Expand Down Expand Up @@ -744,7 +747,7 @@ public boolean hasValidSite() {
}

public boolean hasValidDrive() {
return drive != null && drives != null;
return drive != null && drives != null && !drives.isEmpty();
}

public void searchSuggestion(Consumer<List<EmbyMediaModel>> prompts) {
Expand Down

0 comments on commit 512bf6f

Please sign in to comment.