Skip to content

Commit ce5a898

Browse files
committed
Release 1.0.4
1 parent 325ed18 commit ce5a898

File tree

6 files changed

+26
-15
lines changed

6 files changed

+26
-15
lines changed

include/UI/ViewControllers/MainViewController.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ DECLARE_CLASS_CODEGEN_INTERFACES(SpotifySearch::UI::ViewControllers, MainViewCon
132132

133133
void doSongSearch(const spotify::Track& track);
134134

135-
std::unique_ptr<CustomSongFilter> customSongFilter_;
135+
CustomSongFilter customSongFilter_;
136136

137137
void startDownloadThread();
138138

qpm.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"info": {
77
"name": "Spotify Search",
88
"id": "spotify-search",
9-
"version": "1.0.3",
9+
"version": "1.0.4",
1010
"url": "https://github.com/TychoTheTaco/Beat-Saber-Spotify-Search",
1111
"additionalData": {
1212
"overrideSoName": "libspotify-search.so",

src/SpriteCache.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ bool isSpriteValid(UnityW<UnityEngine::Sprite> sprite) {
1919
if (!texture) {
2020
return false;
2121
}
22+
if (!UnityEngine::Object::IsNativeObjectAlive(texture)) {
23+
return false;
24+
}
2225

2326
return true;
2427
}

src/UI/ViewControllers/MainViewController.cpp

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,8 @@ void MainViewController::onSpotifyTrackListRetryButtonClicked() {
339339
}
340340

341341
void MainViewController::setFilter(const CustomSongFilter& customSongFilter) {
342-
customSongFilter_ = std::make_unique<CustomSongFilter>(customSongFilter);
342+
customSongFilter_ = customSongFilter;
343+
customSongFilter_.includeDownloadedSongs_ = isShowingDownloadedMaps_;
343344
if (selectedTrack_) {
344345
doSongSearch(*selectedTrack_);
345346
}
@@ -353,7 +354,7 @@ void MainViewController::ctor() {
353354
isLoadingMoreSpotifyPlaylists_ = false;
354355
allTracksLoaded_ = false;
355356
allPlaylistsLoaded_ = false;
356-
customSongFilter_ = std::make_unique<CustomSongFilter>();
357+
customSongFilter_ = CustomSongFilter();
357358
isShowingAllTracksByArtist_ = false;
358359
isShowingDownloadedMaps_ = true;
359360
currentSongFilter_ = SpotifySearch::Filter::DEFAULT_SONG_FILTER_FUNCTION;
@@ -650,11 +651,12 @@ void MainViewController::doSongSearch(const spotify::Track& track) {
650651
searchResultsListViewErrorContainer_->get_gameObject()->set_active(false);
651652

652653
isSearchInProgress_ = true;
653-
std::thread([this, track]() {
654+
const CustomSongFilter customSongFilter = customSongFilter_;
655+
std::thread([this, track, customSongFilter]() {
654656
SongDetailsCache::SongDetails* songDetails = SongDetailsCache::SongDetails::Init().get();
655-
std::vector<const SongDetailsCache::Song*> songs = songDetails->FindSongs([this](const SongDetailsCache::SongDifficulty& songDifficulty) {
657+
std::vector<const SongDetailsCache::Song*> songs = songDetails->FindSongs([customSongFilter](const SongDetailsCache::SongDifficulty& songDifficulty) {
656658
// Difficulty
657-
const std::vector<SongDetailsCache::MapDifficulty>& filterMapDifficulties = customSongFilter_->difficulties_;
659+
const std::vector<SongDetailsCache::MapDifficulty>& filterMapDifficulties = customSongFilter.difficulties_;
658660
if (!filterMapDifficulties.empty()) {
659661
const SongDetailsCache::MapDifficulty mapDifficulty = songDifficulty.difficulty;
660662
if (!std::ranges::contains(filterMapDifficulties, mapDifficulty)) {
@@ -663,7 +665,7 @@ void MainViewController::doSongSearch(const spotify::Track& track) {
663665
}
664666

665667
// Show downloaded songs
666-
if (!customSongFilter_->includeDownloadedSongs_) {
668+
if (!customSongFilter.includeDownloadedSongs_) {
667669
if (SongCore::API::Loading::GetLevelByHash(songDifficulty.song().hash())) {
668670
return false;
669671
}
@@ -1013,9 +1015,8 @@ void MainViewController::onHideDownloadedMapsButtonClicked() {
10131015
controller->HideHintInstant(hoverHintComponent);
10141016
controller->SetupAndShowHintPanel(hoverHintComponent);
10151017

1016-
auto csf = std::move(customSongFilter_);
1017-
csf->includeDownloadedSongs_ = isShowingDownloadedMaps_;
1018-
setFilter(*csf);
1018+
customSongFilter_.includeDownloadedSongs_ = isShowingDownloadedMaps_;
1019+
setFilter(customSongFilter_);
10191020
}
10201021

10211022
void MainViewController::onDownloadButtonClicked() {

tools/build_and_run.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,17 +159,21 @@ def deploy(
159159
mod_files = mod_json['modFiles']
160160
late_mod_files = mod_json['lateModFiles']
161161

162+
lib_prefix_path_release = project_dir / 'build'
163+
lib_prefix_path_debug = lib_prefix_path_release / 'debug'
164+
lib_prefix_path = lib_prefix_path_release
165+
162166
for mod_file in mod_files:
163167
result = adb.push(
164-
project_dir / 'build' / 'debug' / mod_file,
168+
lib_prefix_path / mod_file,
165169
'/sdcard/ModData/com.beatgames.beatsaber/Modloader/early_mods/'
166170
)
167171
if result.returncode != 0:
168172
raise RuntimeError(f'Command Failed! Exit Code = {result.returncode}')
169173

170174
for mod_file in late_mod_files:
171175
result = adb.push(
172-
project_dir / 'build' / 'debug' / mod_file,
176+
lib_prefix_path / mod_file,
173177
'/sdcard/ModData/com.beatgames.beatsaber/Modloader/mods/'
174178
)
175179
if result.returncode != 0:

tools/decode.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ def main():
2020
temp_dir = Path('./temp')
2121
temp_dir.mkdir(exist_ok=True)
2222

23+
symbols_dir = temp_dir
24+
if symbols_arg:
25+
symbols_dir = Path(symbols_arg)
26+
2327
# Pull the debug library from the device
2428
if not symbols_arg:
2529
print(Color.CYAN('Pulling libraries from device...'))
@@ -65,15 +69,14 @@ def main():
6569
project_root_dir = (Path(__file__) / '..' / '..').resolve()
6670
build_output_dir = project_root_dir / 'build'
6771

68-
symbol_dir = temp_dir
6972
print(ndk_stack_exe)
7073

7174
for path in total_paths:
7275
print(Color.CYAN(f'Decoding: {path}'))
7376
process = subprocess.run([
7477
str(ndk_stack_exe.absolute()),
7578
'-sym',
76-
str(symbol_dir),
79+
str(symbols_dir),
7780
'-i',
7881
path.absolute()
7982
], stderr=subprocess.STDOUT)

0 commit comments

Comments
 (0)