@@ -16,6 +16,7 @@ public class BeatSaver
16
16
{
17
17
private const string BeatSaverURLPrefix = "https://api.beatsaver.com" ;
18
18
private static readonly string CustomSongsFolder = Path . Combine ( "Beat Saber_Data" , "CustomLevels" ) ;
19
+ private static readonly string CustomWIPSongsFolder = Path . Combine ( "Beat Saber_Data" , "CustomWIPLevels" ) ;
19
20
private const bool BypassDownloadCounter = false ;
20
21
21
22
public static async Task < BeatSaverMap > GetFromKey ( string Key , bool showNotification = true )
@@ -139,19 +140,23 @@ public static async Task<string> InstallMap(BeatSaverMap Map, bool showNotificat
139
140
throw new Exception ( "Could not find map version." ) ;
140
141
}
141
142
142
- string zip = Path . Combine ( Utils . BeatSaberPath , CustomSongsFolder , Map . HashToDownload ) + ".zip" ;
143
+ string state = responseMap . versions [ 0 ] . state ;
144
+ string targetSongDirectory = state . Equals ( "Published" ) ? CustomSongsFolder : CustomWIPSongsFolder ;
145
+
146
+ string zip = Path . Combine ( Utils . BeatSaberPath , targetSongDirectory , Map . HashToDownload ) + ".zip" ;
143
147
string mapName = string . Concat ( ( $ "{ responseMap . id } ({ responseMap . metadata . songName } - { responseMap . metadata . levelAuthorName } )")
144
148
. Split ( ModAssistant . Utils . Constants . IllegalCharacters ) ) ;
145
- string directory = Path . Combine ( Utils . BeatSaberPath , CustomSongsFolder , mapName ) ;
149
+
150
+ string directory = Path . Combine ( Utils . BeatSaberPath , targetSongDirectory , mapName ) ;
146
151
147
152
#pragma warning disable CS0162 // Unreachable code detected
148
153
if ( BypassDownloadCounter )
149
154
{
150
- await Utils . DownloadAsset ( mapVersion . downloadURL , CustomSongsFolder , Map . HashToDownload + ".zip" , mapName , showNotification , true ) ;
155
+ await Utils . DownloadAsset ( mapVersion . downloadURL , targetSongDirectory , Map . HashToDownload + ".zip" , mapName , showNotification , true ) ;
151
156
}
152
157
else
153
158
{
154
- await Utils . DownloadAsset ( mapVersion . downloadURL , CustomSongsFolder , Map . HashToDownload + ".zip" , mapName , showNotification , true ) ;
159
+ await Utils . DownloadAsset ( mapVersion . downloadURL , targetSongDirectory , Map . HashToDownload + ".zip" , mapName , showNotification , true ) ;
155
160
}
156
161
#pragma warning restore CS0162 // Unreachable code detected
157
162
0 commit comments