Skip to content

Commit

Permalink
Added support for the abcence of local songs
Browse files Browse the repository at this point in the history
  • Loading branch information
Matheo-bis committed May 22, 2024
1 parent 922b31c commit 91a56f3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
1 change: 1 addition & 0 deletions Assets/NetManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ public void SearchNew(string filter)
public void SearchLocal()
{
TextAsset localSongs = Resources.Load<TextAsset>("LocalSongs");
if (localSongs == null || localSongs.text == string.Empty) throw new FileNotFoundException("Local Kara file not found.")
Karas = JsonSerializer.Deserialize<SearchResult>(localSongs.text).Content;
}

Expand Down
8 changes: 0 additions & 8 deletions Assets/Resources.meta

This file was deleted.

11 changes: 9 additions & 2 deletions Assets/UIManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,14 @@ public void OpenSystemKeyboard()
public void OpenLocalSongs()
{
isLocal = true;
netManager.SearchLocal();
ShowResults(netManager.Karas);
try
{
netManager.SearchLocal();
ShowResults(netManager.Karas);
}
catch (Exception e)
{
text.text = e.Message;
}
}
}

0 comments on commit 91a56f3

Please sign in to comment.