Skip to content

Commit

Permalink
Режим оффлайн не должен оказывать влияния на экспорт
Browse files Browse the repository at this point in the history
  • Loading branch information
sadr0b0t committed Feb 7, 2023
1 parent 386e34a commit d7a84f8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions app/src/main/java/su/sadrobot/yashlang/controller/DataIO.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public static String exportPlaylistsToMarkdownOrYtdlScript(

final List<VideoItem> videoItems = exportSkipBlocked ?
VideoDatabase.getDbInstance(context).
videoItemPubListsDao().getByPlaylist(plInfo.getId()) :
videoItemPubListsDefaultDao().getByPlaylist(plInfo.getId()) :
VideoDatabase.getDbInstance(context).
videoItemDao().getByPlaylistAll(plInfo.getId());
for (final VideoItem videoItem : videoItems) {
Expand Down Expand Up @@ -144,7 +144,7 @@ public static String exportPlaylistsToMarkdownOrYtdlScript(
stringBuilder.append("# Starred").append("\n");

final List<VideoItem> videoItems = VideoDatabase.getDbInstance(context).
videoItemPubListsDao().getStarred();
videoItemPubListsDefaultDao().getStarred();
for (final VideoItem videoItem : videoItems) {
if (exportYtdlScript) {
stringBuilder.append("youtube-dl " + videoItem.getItemUrl());
Expand Down Expand Up @@ -262,7 +262,7 @@ public static JSONObject exportPlaylistsToJSON(

final JSONArray jsonVideoItems = new JSONArray();
final List<VideoItem> videoItems = exportSkipBlocked ?
VideoDatabase.getDbInstance(context).videoItemPubListsDao().getByPlaylist(plInfo.getId()) :
VideoDatabase.getDbInstance(context).videoItemPubListsDefaultDao().getByPlaylist(plInfo.getId()) :
VideoDatabase.getDbInstance(context).videoItemDao().getByPlaylistAll(plInfo.getId());

for (final VideoItem videoItem : videoItems) {
Expand All @@ -288,7 +288,7 @@ public static JSONObject exportPlaylistsToJSON(
final JSONArray jsonStarred = new JSONArray();

final List<VideoItem> videoItems =
VideoDatabase.getDbInstance(context).videoItemPubListsDao().getStarred();
VideoDatabase.getDbInstance(context).videoItemPubListsDefaultDao().getStarred();
for (final VideoItem videoItem : videoItems) {
final JSONObject jsonVideoItem = new JSONObject();

Expand All @@ -307,7 +307,7 @@ public static JSONObject exportPlaylistsToJSON(
final JSONArray jsonBlacklist = new JSONArray();

final List<VideoItem> videoItems =
VideoDatabase.getDbInstance(context).videoItemPubListsDao().getStarred();
VideoDatabase.getDbInstance(context).videoItemPubListsDefaultDao().getStarred();
for (final VideoItem videoItem : videoItems) {
final JSONObject jsonVideoItem = new JSONObject();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ public abstract class VideoDatabase extends RoomDatabase {
public abstract ProfileDao profileDao();
public abstract StreamCacheDao streamCacheDao();

protected abstract VideoItemPubListsDao videoItemPubListsDefaultDao();
protected abstract VideoItemPubListsOfflineDao videoItemPubListsOfflineDao();
public abstract VideoItemPubListsDao videoItemPubListsDefaultDao();
public abstract VideoItemPubListsOfflineDao videoItemPubListsOfflineDao();

public VideoItemPubListsDao videoItemPubListsDao() {
if (!ConfigOptions.getOfflineModeOn(context)) {
Expand Down

0 comments on commit d7a84f8

Please sign in to comment.