halsafar / BeatSaberSongBrowser

BeatSaber plugin, adds much needed functionality to the song selection interface.
MIT License
164 stars 41 forks source link

Favorites and Sorting issues #62

Closed Xplox55 closed 4 years ago

Xplox55 commented 5 years ago

Hello,

Issue had started with favorites not being saved. Reinstalled mods, clean installed game, still the same issue. I would add a song as a favorite > favorite would be written to the .json in the playlists folder > In game still listed and showed 0 favorites. It has now come to the point that any sorting (or I just didn't notice before) does not work. Below are the messages from --verbose regarding the SongBrowser.

Same issue occurs trying 3.0.5 and 3.0.4. Any ideas?

[INFO @ 15:44:21 | ] [SongBrowser @ 15:44 - Info] Determining song download time and determining mappings took 23ms [INFO @ 15:44:21 | ] [SongBrowser @ 15:44 - Info] Updating songs infos took 31ms [INFO @ 15:44:21 | ] [SongBrowser @ 15:44] SongBrowser UI crashed trying to update the internal song lists: -System.InvalidOperationException-Sequence contains no matching element [INFO @ 15:44:21 | ] at System.Linq.Enumerable.First[TSource] (System.Collections.Generic.IEnumerable1[T] source, System.Func2[T,TResult] predicate) [0x00011] in <1b13ba6391c74847bbc3eddc86df7eee>:0 [INFO @ 15:44:21 | ] at SongBrowser.UI.SongBrowserUI.GetLevelPackByPackId (System.String levelPackId) [0x00024] in :0 [INFO @ 15:44:21 | ] at SongBrowser.UI.SongBrowserUI.UpdateLevelPackSelection () [0x000fe] in :0 [INFO @ 15:44:21 | ] at SongBrowser.UI.SongBrowserUI.UpdateLevelDataModel () [0x00056] in :0 [INFO @ 15:44:21 | ] [SongBrowser @ 15:44 - Info] Refreshing the song list view. [INFO @ 15:44:21 | _] [BeatSaverDownloader | LOG] Selected pack: Custom Maps [CRITICAL @ 15:44:21 | UnityEngine] NullReferenceException: Object reference not set to an instance of an object [CRITICAL @ 15:44:21 | UnityEngine] CustomUI.Utilities.ReflectionUtil.GetPrivateField[T] (System.Object obj, System.String fieldName) (at <96cc36f4057440e49c8c3bc00a41dffb>:0) [CRITICAL @ 15:44:21 | UnityEngine] BeatSaverDownloader.UI.SongListTweaks+d_40.MoveNext () (at <63c8152f948244ea95448606b7d330cd>:0) [CRITICAL @ 15:44:21 | UnityEngine] UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <1e56ad9145b44dbfa81599f39af43dd3>:0) [INFO @ 15:44:23 | ] [SongBrowser @ 15:44 - Info] Refreshing the song list view. [INFO @ 15:44:24 | _] [SongBrowser @ 15:44 - Info] Refreshing the song list view.

Xplox55 commented 5 years ago

I see there is a new version - I'll give 3.0.6 a try today and see if there's any difference!

Xplox55 commented 5 years ago

Same problem and error messages with 3.0.6 :/ The UI works and sorting options are visible/colors change when I select them, but no sorting or changing happens to the songs in view.

I'm going to put in a new SSD in my system, install Beat Saber clean there and see if I get any different results.

Edit: A bit more info, that error info from --verbose doesn't actually show up until I go into my songs and start to try to sort. There aren't any errors when I boot up the game and get to my main menu - only when I go into my songs and try to select anything.

Edit2: Okay I think I figured out the problem...at least part of it. The mod either isn't reading or isn't adding favorite songs properly to the .json. Entries such as: { "key": "10650-11212", "songName": "Soulless 5", "hash": null }, Or { "key": "17520-19058", "songName": "Ascension to Heaven", "hash": null }, Show up in my favorites list. Granted I had to restart the game to get them to show up, and they still don't sort but, progress!

Entries such as: { "key": "C7E33D948E63D57012B777F216E1551B∎Black lotus ∎Wa.∎Aithke∎200∎", "songName": "Black lotus ", "hash": null }, Or { "key": "8497A91F208CCAE83D9735443BEC13AD∎Airborne Robots∎F-777∎JonathanRune∎100∎", "songName": "Airborne Robots", "hash": null }, Do not show up, and I'm guessing break the rest of the playlist. I can sort the "Custom Songs" playlist as normal, but the favorites playlist just breaks, and I'm guessing it's because of those entries. This is on a clean favorites .json file, not one I re-added or anything. Ideas on a fix?

halsafar commented 5 years ago

Can just attach your SongBrowserFavorites.json file? If you do not want to share it publicly then ping me on discord. There is a good chance a few songs in the file are causing some exception and partially breaking functionality.

Xplox55 commented 5 years ago

Sent the .json in Discord.

halsafar commented 5 years ago

I added a fix in 4.0.0+ that might address your issue. I tested your favorites file and a few others.

Xplox55 commented 5 years ago

With version 4.1.0 installed, I can now successfully sort the favorites list. The issue with some songs not showing up is still present, as well as the playlist not updating live when I add/remove songs from favorites. If I quit/reload the game, the favorites are then updated, but only with songs with a key of "key": "17520-19058". Keys that look like "key": "C7E33D948E63D57012B777F216E1551B∎Black lotus ∎Wa.∎Aithke∎200∎" still do not show up in the favorites list. Thank you for the progress!

halsafar commented 5 years ago

Glad we are making some progress.

The info you just provided is very useful. I think I know where the problem is. I will update this when I have a fix.

Thanks again!

jb2kewl commented 5 years ago

Hello Halsafar.. I am having the same issue.. I also noticed that some song names have a single quote in them, which might be causing some issues as well.. I have attached my favorites file, so you can test out your fix, don't judge me!

BTW - Thx for the hard work!

favoriteSongs - Copy.txt

halsafar commented 5 years ago

That file is from Downloader. SongBrowser uses Playlists/SongBrowserFavorites.json

halsafar commented 5 years ago

I've discovered a bug however. Might be related.

It seems if any song in your favorites list is not available for lookup on BeatSaver then all songs after it will not show up as a favorite.

Xplox55 commented 5 years ago

One thing I noticed while waiting for the 1.1.0 update - I had updated my game and installed other mods. While playing, my favorites playlist was displayed properly, and all of the songs were on there. So that's while not using the BSSongBrowser. Just wanted to add that the playlist displayed normally without the mod. Thanks! Also thanks for getting V1.1.0 compatible out, going to be trying it out now!

Edit: Okay not quite trying it out now, I'm not sure how to install the updated version with just the big ol .zip of the mod, so I'll have to wait.

halsafar commented 5 years ago

5.0.0 is out now. See if that helps this issue.

trinode commented 5 years ago

I'm having issues with favorites not loading with 5.0

Using just beatsaber downloader the format of the playlist is:

    {
      "newKey": "",
      "key": "1234",
      "songName": "Song Name",
      "hash": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "levelId": "custom_level_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    },

whereas when using SongBrowser the format is:

    {
      "key": "",
      "songName": "Song Name",
      "hash": "custom_level_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    }

levelId is in hash, and hash is stored nowhere. Presuming they changed format at some point

So when you load the game after saving favorites, the list is empty but says "3 songs, 0 downloaded" for example.

Happy to test changes if required.

halsafar commented 5 years ago

Confirmed. There is actually two bugs here. Fixed them both in the devel branch. Will come with the next release.

Both fixes will automagically apply next time you add/remove a favorite using SongBrowser. Then restart the game.

  1. Writing levelId to hash field. Fixed by splitting out the hash.
  2. Old favorites missing a hash only have a key, hit beatsaver to find the hash and update.
Xplox55 commented 5 years ago

Testing 5.0 I've lost a little bit of functionality. There are no longer any favorites in my favorites list, similar to the post above mine shows 22 songs, 0 downloaded. Additionally, other filters are no longer working properly, in a way. (Plays, PP, etc.) As seen in the two screenshots, this song is always my top for plays - many failed attempts :) Title is now different post 5.0 update. Not sure if this means anything but I hope it helps, and I look forward to trying out the new fix release once it's out! Pre 5.0.0 : image

Post 5.0.0 : image

image

halsafar commented 5 years ago

5.2.0 should hopefully address this for real this time. https://github.com/halsafar/BeatSaberSongBrowser/releases/tag/5.2.0

@Xplox55 - We took down the old PP data. New version fixes this

@trinode The playlist will self heal. The important notes are in that release page but here they are again for reference:

Favorites were broken in the previous few builds. Your favorites playlist will self heal if you add or remove a song (causing it to save). Now restart the game and it should be functional again. No songs will be lost.

Let me know if that fixes this for you.

Migushthe2nd commented 5 years ago

Sorting by pp and stars still does not seem to work

WesVleuten commented 5 years ago

They just did network maintenance at the CDN. During that time the delivery of assets was a bit spotty. It should be resolved. Could you try again @Migushthe2nd ?

Migushthe2nd commented 5 years ago

Nope. Sorting from lowest to highest sorts them from Z-A (those are ranked songs tho), but from highest to lowest does nohing (for both pp and stars)

halsafar commented 5 years ago

Are you sure you updated to 5.2.0 or higher? The update isnt on BeatMods yet. Otherwise provide more info since everyone testing 5.2.0+ has no issues here.

Migushthe2nd commented 5 years ago

I am on 5.2.0 Edit: Ok, now it works fine :? I launched the game once without the CustomLevels folder (with 2001 songs) and that seems to have fixed it.

halsafar commented 5 years ago

In the next version I am going to disable PP and Star sorting if the BeatStar data from Wes hasn't downloaded or failed. This will at least make it clear that the data is missing if that is the problem.

Xplox55 commented 5 years ago

Hello again all,

Keep everything below with a grain of salt, I have yet to do much troubleshooting and should probably perform a reinstall of the game, as I haven't played for a few weeks, ran the mod assistant and IPA.exe to get things up and running.

Favorites seem to currently be in a much better state, for me at least. Most of my favorites are now showing (I opened the game and it said 663 songs, 0 downloaded.) I selected Download and it did download ~500 of them. Granted, the songs were already all there in my CustomSongs folder. Although quite a few of my most played favorites songs are not showing up in the list for some reason. (I can search them in CustomSongs in game but they don't show up in my favorites list.)

Adding to favorites, unfortunately, does not seem to be working for me.

Sorting by PP appears to work along with most of the rest of the sorting options I had tried. Yay!

One thing to note, my play count does seem to be off, as in either all my plays were reset or it's not being sorted properly. Anybody know which might be the case?

Thank you again for all the hard work on this!

halsafar commented 4 years ago

Sorry to put an end to our excellent conversation. I've completed removed all code regarding favorites from Song Browser. Beat Saber itself has a favorite system which SongBrowser now uses. Add/Remove favorites is now Beat Sabers responsibility. Your existing favorites get migrated on first load. Filtering by favorites still work. We can open new issues if some interaction there is broken.