• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[fixed in 1.9.0] How to filter by Duration?
#1
I can select "Duration" in the filter section, but I fail when it comes to entering the value I'm looking for. I suppose I have to enter the time in a specific format.
How can I find e.g.  all songs with a duration of 3:00
first language: German
Acer A1-830, Android 4.4.2 - HP x2 210 G2 Detachable, Win 10 22H2 - Huawei Media Pad T5, Android 8.0 - Boox Tab Ultra C, Android 11
www.moonlightcrisis.de - www.basdjo.de - www.frankenbaend.de


Reply
#2
I will check on this but I believe it's doing the comparison based upon the total number of seconds (as that is how I store it internally). So if you have a song with a duration of 3:47, that's 227 seconds, which is the value it's comparing. I'll have to adjust the filtering to be a little smarter than that and accept other formats though.
Reply
#3
No, it's not by time in seconds. It seems to be something like "search for string containing the specified characters" as it is the case for other fields. It's not usable at all for Duration.

My use case as a background info:
I want to use MSPs calculation of setlist's total duration. That requires that Duration is specified for all songs. If I don't know a song's duration (yet), I want to enter a default duration like 3:00, 3:01 or the like and want to reserve this default value for estimated durations. So I want to search for songs that already have that default value as a "real" duration and I want to search songs with Duration = 0:00 (not entered).

It also could be achieved by this feature request:
- don't enter a default value for Duration in the database
- make "not specified" and 0:00 two different database values for Duration
- allow specifying a default value for Duration that is used ONLY when a totol Duration of a setlist is calculated and a song's Duration is "not specified"
first language: German
Acer A1-830, Android 4.4.2 - HP x2 210 G2 Detachable, Win 10 22H2 - Huawei Media Pad T5, Android 8.0 - Boox Tab Ultra C, Android 11
www.moonlightcrisis.de - www.basdjo.de - www.frankenbaend.de


Reply
#4
Okay, you are right, I'm doing string comparison of the song's duration against whatever is entered in the search bar, but I'm incorrectly stripping punction characters such as the ":" as this is normally required for other searches. I'm fixing the code right now so that the comparison is different when the search is set to "Duration".

Due to me storing duration as an integer value in the database, there really isn't an easy way for me to default the duration to nothing. I guess I could set it to something like -999, and in the song editor, display "Not Set" for duration instead of 0:00 if I detect that negative value. Then I will have to code when calculating setlist duration to ignore all negative values, and make sure nothing in my code explodes if there is a negative value in that field.
Reply
#5
Thanks for checking, Mike.
Don't invest too much effort in that probably pretty rare use case. I'm fine when the basic functionality works.
first language: German
Acer A1-830, Android 4.4.2 - HP x2 210 G2 Detachable, Win 10 22H2 - Huawei Media Pad T5, Android 8.0 - Boox Tab Ultra C, Android 11
www.moonlightcrisis.de - www.basdjo.de - www.frankenbaend.de


Reply
#6
It works fine in 1.9.0. Thank you Mike.
first language: German
Acer A1-830, Android 4.4.2 - HP x2 210 G2 Detachable, Win 10 22H2 - Huawei Media Pad T5, Android 8.0 - Boox Tab Ultra C, Android 11
www.moonlightcrisis.de - www.basdjo.de - www.frankenbaend.de


Reply




Users browsing this thread:
3 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2024 MyBB Group.