Skip to content

Commit d900830

Browse files
committed
Release 1.0.1
1 parent 0dacebd commit d900830

File tree

7,577 files changed

+441145
-187
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

7,577 files changed

+441145
-187
lines changed

.gitea/workflows/build.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Build
2+
3+
on:
4+
- push
5+
6+
jobs:
7+
docker:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Check out repository code
11+
uses: actions/checkout@v4
12+
13+
- name: Install dependencies
14+
run: |
15+
sudo apt-get update
16+
sudo apt-get install -y cmake ninja-build
17+
18+
# QPM
19+
TMP_DIR="/tmp/qpm"
20+
mkdir -p "$TMP_DIR"
21+
curl -L "https://github.com/QuestPackageManager/QPM.CLI/releases/download/v1.5.2/qpm-linux-x64-static.zip" -o "$TMP_DIR/qpm.zip"
22+
unzip -o "$TMP_DIR/qpm.zip" -d "$TMP_DIR"
23+
QPM_BIN=$(find "$TMP_DIR" -type f -name qpm)
24+
chmod +x "$QPM_BIN"
25+
sudo ln -sf "$QPM_BIN" /usr/local/bin/qpm
26+
27+
# NDK
28+
qpm ndk download 27
29+
NDK_PATH=$(qpm ndk list | grep -F "27." | awk '{print $3}')
30+
echo "ANDROID_NDK_HOME=$NDK_PATH" >> $GITEA_ENV
31+
32+
- name: Build
33+
run: |
34+
qpm restore
35+
cd tools
36+
python3 build_and_run.py --clean --build-only
37+
python3 build_and_run.py --build-only --build-type release
38+
39+
- name: Upload artifacts
40+
uses: actions/upload-artifact@v3
41+
with:
42+
name: Artifacts
43+
compression-level: 0
44+
path: |
45+
build/libspotify-search.so
46+
build/debug/libspotify-search.so
47+
build/spotify-search-v*.qmod

.github/workflows/build.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Build
2+
3+
on:
4+
- push
5+
6+
jobs:
7+
docker:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Check out repository code
11+
uses: actions/checkout@v4
12+
13+
- name: Install dependencies
14+
run: |
15+
sudo apt-get update
16+
sudo apt-get install -y cmake ninja-build
17+
18+
# QPM
19+
TMP_DIR="/tmp/qpm"
20+
mkdir -p "$TMP_DIR"
21+
curl -L "https://github.com/QuestPackageManager/QPM.CLI/releases/download/v1.5.2/qpm-linux-x64-static.zip" -o "$TMP_DIR/qpm.zip"
22+
unzip -o "$TMP_DIR/qpm.zip" -d "$TMP_DIR"
23+
QPM_BIN=$(find "$TMP_DIR" -type f -name qpm)
24+
chmod +x "$QPM_BIN"
25+
sudo ln -sf "$QPM_BIN" /usr/local/bin/qpm
26+
27+
# NDK
28+
qpm ndk download 27
29+
NDK_PATH=$(qpm ndk list | grep -F "27." | awk '{print $3}')
30+
echo "ANDROID_NDK_HOME=$NDK_PATH" >> $GITHUB_ENV
31+
32+
- name: Build
33+
run: |
34+
qpm restore
35+
cd tools
36+
python3 build_and_run.py --clean --build-only
37+
python3 build_and_run.py --build-only --build-type release
38+
39+
- name: Upload artifacts
40+
uses: actions/upload-artifact@v4
41+
with:
42+
name: Artifacts
43+
compression-level: 0
44+
path: |
45+
build/libspotify-search.so
46+
build/debug/libspotify-search.so
47+
build/spotify-search-v*.qmod

.gitignore

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
# Build output
2-
build/
3-
*.qmod
2+
/build/
43

54
# Python virtual environment
65
venv/
76

87
# External dependencies
9-
extern/
8+
/extern/
109

1110
# Auto-generated files
12-
include/Assets.hpp
11+
/include/Assets.hpp
12+
mod.json
13+
qpm.shared.json
1314

1415
# Crash dump
1516
crash.txt

assets/MainViewController.bsml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,9 @@
6464
<vertical horizontal-fit="Unconstrained" pref-width="70">
6565
<horizontal pref-height="6">
6666
<text text='Search Results' align="Left"/>
67-
<horizontal pad-right="-4">
67+
<horizontal pad-right="-4" child-align="MiddleRight" spacing="3" horizontal-fit="MinSize">
6868
<icon-button active="false" pad="0" id="showAllByArtistButton_" icon="#GuestUserIcon" on-click="onShowAllByArtistButtonClicked" pref-width="8" pref-height="6" hover-hint="Show all songs from this artist"/>
69+
<icon-button active="false" pad="0" id="hideDownloadedMapsButton_" on-click="onHideDownloadedMapsButtonClicked" pref-width="8" pref-height="6" hover-hint="Hide downloaded maps"/>
6970
</horizontal>
7071
</horizontal>
7172

assets/show_downloaded_songs.png

1.33 MB
Loading

include/CustomSongFilter.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ struct CustomSongFilter {
1212
}
1313

1414
std::vector<SongDetailsCache::MapDifficulty> difficulties_;
15+
bool includeDownloadedSongs_ = true;
1516
};
1617

1718
}

include/SpriteCache.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ class SpriteCache {
88

99
public:
1010

11-
UnityW<UnityEngine::Sprite> get(const std::string& key);
11+
UnityW<UnityEngine::Sprite> get(const std::string_view key);
1212

13-
void add(const std::string& key, UnityW<UnityEngine::Sprite> sprite);
13+
void add(const std::string_view key, UnityW<UnityEngine::Sprite> sprite);
1414
void addToDiskCache(const std::string& key, const std::vector<uint8_t>& data);
1515

1616
static SpriteCache& getInstance() {
@@ -20,7 +20,7 @@ class SpriteCache {
2020

2121
private:
2222

23-
std::string getKeyHash(const std::string& key);
23+
std::string getKeyHash(const std::string_view key);
2424

2525
std::unordered_map<std::string, UnityW<UnityEngine::Sprite>> memoryCache_;
2626

include/ThreadPool.hpp

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#pragma once
2+
3+
#include <functional>
4+
#include <thread>
5+
6+
#include "Log.hpp"
7+
8+
namespace SpotifySearch {
9+
10+
class ThreadPool {
11+
public:
12+
struct Job {
13+
size_t id_;
14+
std::function<void()> task_;
15+
16+
bool operator==(const Job& other) const {
17+
return id_ == other.id_;
18+
}
19+
};
20+
21+
void submit(const std::function<void()>& task);
22+
23+
void wait();
24+
25+
private:
26+
size_t maxThreadCount_ = std::thread::hardware_concurrency();
27+
std::vector<Job> jobs_;
28+
std::mutex mutex_;
29+
std::condition_variable conditionVariable_;
30+
31+
void onJobFinished(const Job& job);
32+
};
33+
34+
}// namespace SpotifySearch

include/UI/ViewControllers/MainViewController.hpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ using BaseViewController = HMUI::ViewController;
2525

2626
namespace SpotifySearch::Filter {
2727

28-
using SongFilterFunction = std::function<std::vector<const SongDetailsCache::Song*>(const spotify::Track& track, const CustomSongFilter& customSongFilter)>;
28+
using SongFilterFunction = std::function<bool(const SongDetailsCache::Song* const song, const spotify::Track& track)>;
2929
using SongScoreFunction = std::function<int(const spotify::Track& track, const SongDetailsCache::Song& song)>;
3030

3131
extern SongFilterFunction DEFAULT_SONG_FILTER_FUNCTION;
@@ -77,6 +77,8 @@ DECLARE_CLASS_CODEGEN_INTERFACES(SpotifySearch::UI::ViewControllers, MainViewCon
7777
DECLARE_INSTANCE_FIELD(UnityW<TMPro::TextMeshProUGUI>, searchResultsListStatusTextView_);
7878
DECLARE_INSTANCE_FIELD(UnityW<UnityEngine::UI::Button>, showAllByArtistButton_);
7979
DECLARE_INSTANCE_METHOD(void, onShowAllByArtistButtonClicked);
80+
DECLARE_INSTANCE_FIELD(UnityW<UnityEngine::UI::Button>, hideDownloadedMapsButton_);
81+
DECLARE_INSTANCE_METHOD(void, onHideDownloadedMapsButtonClicked);
8082

8183
// Custom Song Preview
8284
DECLARE_INSTANCE_FIELD(TMPro::TextMeshProUGUI*, previewSongNameTextView_);
@@ -113,6 +115,8 @@ DECLARE_CLASS_CODEGEN_INTERFACES(SpotifySearch::UI::ViewControllers, MainViewCon
113115
std::atomic<bool> allPlaylistsLoaded_;
114116

115117
std::atomic<bool> isShowingAllTracksByArtist_;
118+
std::atomic<bool> isShowingDownloadedMaps_;
119+
116120
SpotifySearch::Filter::SongFilterFunction currentSongFilter_;
117121
SpotifySearch::Filter::SongScoreFunction currentSongScore_;
118122

include/Utils.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ std::string jsonDocumentToString(const rapidjson::Value& value);
4141

4242
SongDetailsCache::MapDifficulty getMapDifficultyFromString(const std::string& text);
4343

44+
void removeRaycastFromButtonIcon(UnityW<UnityEngine::UI::Button> button);
45+
4446
namespace json {
4547

4648
std::string getString(const rapidjson::Value& json, const std::string& key);

0 commit comments

Comments
 (0)