Go Back   Flash Flash Revolution > Flash Flash Revolution > FFR General Talk > Bug Reports and Suggestions
Register FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
Old 06-16-2013, 02:55 AM   #1
Viisbyxa
FFR Veteran
FFR Veteran
 
Viisbyxa's Avatar
 
Join Date: Jul 2012
Posts: 358
Default Sort songs list by length

For a while it's been bothering me that the song list can't be sorted by difficulty, both for consistency and because sometimes I want to find the longest or shortest songs. Now that I know JavaScript, I would be very happy to write the code for it if I could see where the rest of the sorting is. Couldn't find it with the Chrome dev tools.
__________________
Two-handed alt (now main) account of Bobogoobo

Best AAAs: Gacha Gacha Cute Figu atto Mate [56], Song of the second moon [52], Musicmaker RX [52], Wish (Reprise) [51], Nyanyanyanyanyanyanya! [51], Exogenesis [51]
Quest for Scarhand: 3+ blackflags on Pure In Asia, blackflag on Iced Innocence
2020 update: all of these got bumped up 4 (rip Scarhand unlock), rusty, new AAA Power Rocket [56?]
2021 semiannual return: Connect (HOUSE SOUL REMIX) [57] (was blackflag from 2013), second blackflag on Call Upon the Seaponies; 2023: Polar 240 [56]
BFs: 127 and counting (as of 2013-11-10)
Viisbyxa is offline   Reply With Quote
Old 06-21-2013, 11:17 PM   #2
Viisbyxa
FFR Veteran
FFR Veteran
 
Viisbyxa's Avatar
 
Join Date: Jul 2012
Posts: 358
Default Re: Sort songs list by length

While I'm here, is there a reason that styles don't apply to the block for regular tokens?
__________________
Two-handed alt (now main) account of Bobogoobo

Best AAAs: Gacha Gacha Cute Figu atto Mate [56], Song of the second moon [52], Musicmaker RX [52], Wish (Reprise) [51], Nyanyanyanyanyanyanya! [51], Exogenesis [51]
Quest for Scarhand: 3+ blackflags on Pure In Asia, blackflag on Iced Innocence
2020 update: all of these got bumped up 4 (rip Scarhand unlock), rusty, new AAA Power Rocket [56?]
2021 semiannual return: Connect (HOUSE SOUL REMIX) [57] (was blackflag from 2013), second blackflag on Call Upon the Seaponies; 2023: Polar 240 [56]
BFs: 127 and counting (as of 2013-11-10)
Viisbyxa is offline   Reply With Quote
Old 06-22-2013, 01:25 AM   #3
bmah
shots FIRED
Global Moderator, User Support, Judge
Global ModeratorFFR Simfile AuthorFFR Veteran
 
bmah's Avatar
 
Join Date: Oct 2003
Location: Edmonton, AB
Age: 35
Posts: 8,448
Default Re: Sort songs list by length

Because time has to be represented by a colon (:), songs cannot be sorted by length. On a similar note, sorting it through a numerical value of seconds would be equally meaningless.

Last edited by bmah; 06-22-2013 at 02:58 AM..
bmah is offline   Reply With Quote
Old 06-22-2013, 01:35 AM   #4
TheSaxRunner05
The Doctor
FFR Veteran
 
TheSaxRunner05's Avatar
 
Join Date: Apr 2006
Age: 35
Posts: 6,145
Default Re: Sort songs list by length

I thought there was a thread awhile back that had all that info, as well as listings for highest max NPS, note totals, most time without a step in a song, and stuff like that too.
__________________


TheSaxRunner05 is offline   Reply With Quote
Old 06-22-2013, 01:43 AM   #5
Viisbyxa
FFR Veteran
FFR Veteran
 
Viisbyxa's Avatar
 
Join Date: Jul 2012
Posts: 358
Default Re: Sort songs list by length

"Cannot" is a strong word. It should be fairly simple to do even without jQuery, by, as you said, converting it to a value of seconds (though I'm pretty sure sorting it as a string would work similarly except for songs longer than ten minutes, which is what, two songs?). How would that be meaningless? Yes, there is a thread for that information, but being able to sort the song list, which is always up to date and more convenient, would be better. Plus, as I said, I don't like it being the only unsortable column for no reason.
__________________
Two-handed alt (now main) account of Bobogoobo

Best AAAs: Gacha Gacha Cute Figu atto Mate [56], Song of the second moon [52], Musicmaker RX [52], Wish (Reprise) [51], Nyanyanyanyanyanyanya! [51], Exogenesis [51]
Quest for Scarhand: 3+ blackflags on Pure In Asia, blackflag on Iced Innocence
2020 update: all of these got bumped up 4 (rip Scarhand unlock), rusty, new AAA Power Rocket [56?]
2021 semiannual return: Connect (HOUSE SOUL REMIX) [57] (was blackflag from 2013), second blackflag on Call Upon the Seaponies; 2023: Polar 240 [56]
BFs: 127 and counting (as of 2013-11-10)
Viisbyxa is offline   Reply With Quote
Old 06-22-2013, 02:49 AM   #6
Doug31
Falcon Paaaauuuunch!!!!!!
FFR Simfile AuthorFFR Veteran
 
Doug31's Avatar
 
Join Date: Jun 2004
Location: Washington
Age: 36
Posts: 6,811
Send a message via AIM to Doug31
Default Re: Sort songs list by length

But it's a problem for songs more than 1 minute. In most languages it would be simple but I assume flash isn't good at handling such things. There is such a thread for it, but it's from when there were only about 500 songs. If only it were something like Java you could just tostring all the times and then split the strings back up to get the information from them. Or you could just change all the times of the songs to just be in seconds and have the stuff with the colon be a calculated field, but I assume it's probably too late to realistically make that kind of change. I don't think there's any easy way it can be done.
__________________
Doug31 is offline   Reply With Quote
Old 06-22-2013, 03:00 AM   #7
bmah
shots FIRED
Global Moderator, User Support, Judge
Global ModeratorFFR Simfile AuthorFFR Veteran
 
bmah's Avatar
 
Join Date: Oct 2003
Location: Edmonton, AB
Age: 35
Posts: 8,448
Default Re: Sort songs list by length

Quote:
Originally Posted by Viisbyxa View Post
converting it to a value of seconds (though I'm pretty sure sorting it as a string would work similarly except for songs longer than ten minutes, which is what, two songs?). How would that be meaningless?
I honestly would like to know that a song is 2:34 and not 154 seconds. Just for sake of standard representation. I can't get a lot of context from 342 seconds worth of music, other than it's probably long to some degree.

I wonder if there's a way to sort by seconds, and then convert that value into the more conventional time as shown with a colon.
bmah is offline   Reply With Quote
Old 06-22-2013, 05:55 AM   #8
Viisbyxa
FFR Veteran
FFR Veteran
 
Viisbyxa's Avatar
 
Join Date: Jul 2012
Posts: 358
Default Re: Sort songs list by length

I linked to the page I was talking about in my first post; it's nothing about in-game information. And I meant that in the JavaScript code that does the sorting, it would internally convert to a seconds value and use that for sorting. I'll just go write the code, though it'll use jQuery and would need adjustment to work without it, which I can do if you'd like to implement this on the page (though I assume incorporating it into existing code would be more efficient). Though it probably wouldn't be terrible to import jQuery for this one page.

Well, I'm not done yet, but here's a preview. Go to Chrome's JS console (Ctrl+Shift+J) and paste this code, then click the Length header.
Code:
(function() {
   var head= document.getElementsByTagName('head')[0];
   var script= document.createElement('script');
   script.type= 'text/javascript';
   script.src= 'http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js';
   head.appendChild(script);
}());

$(document).ready(function() {
    $('table:first tr:first th:nth-child(7)').replaceWith('<th id="lengthSort" nowrap><a>Length</a></th>');
    $('#lengthSort').css({'color':'#4A84B5', 'cursor':'pointer'}).on('click', function() {
        var rows = $('table:first tr').toArray(), rowsString = '';

        rows.shift();
        rows.sort(function(a, b) {
            var time1 = $(a).children('td:nth-child(7)').text().split(':'),
            time2 = $(b).children('td:nth-child(7)').text().split(':');
        
            time1 = time1[0] * 60 + time1[1] * 1;
            time2 = time2[0] * 60 + time2[1] * 1;

            return time1 - time2;
        });

        for (var i = 0; i < rows.length; i++) {
            rowsString += $(rows[i])[0].outerHTML;
        }

        $('table:first').replaceWith('<table width="770">' + $('table:first tr:first')[0].outerHTML + rowsString + '</table>');
    });
});
__________________
Two-handed alt (now main) account of Bobogoobo

Best AAAs: Gacha Gacha Cute Figu atto Mate [56], Song of the second moon [52], Musicmaker RX [52], Wish (Reprise) [51], Nyanyanyanyanyanyanya! [51], Exogenesis [51]
Quest for Scarhand: 3+ blackflags on Pure In Asia, blackflag on Iced Innocence
2020 update: all of these got bumped up 4 (rip Scarhand unlock), rusty, new AAA Power Rocket [56?]
2021 semiannual return: Connect (HOUSE SOUL REMIX) [57] (was blackflag from 2013), second blackflag on Call Upon the Seaponies; 2023: Polar 240 [56]
BFs: 127 and counting (as of 2013-11-10)

Last edited by Viisbyxa; 06-22-2013 at 07:44 AM..
Viisbyxa is offline   Reply With Quote
Old 06-22-2013, 02:01 PM   #9
emerald000
the Mathemagician~
Retired StaffFFR Veteran
 
emerald000's Avatar
 
Join Date: Nov 2005
Location: Quebec City
Age: 33
Posts: 1,320
Send a message via Skype™ to emerald000
Default Re: Sort songs list by length

The sorting by length should be working now.
emerald000 is offline   Reply With Quote
Old 06-22-2013, 07:20 PM   #10
Viisbyxa
FFR Veteran
FFR Veteran
 
Viisbyxa's Avatar
 
Join Date: Jul 2012
Posts: 358
Default Re: Sort songs list by length

And so it is, thanks.
__________________
Two-handed alt (now main) account of Bobogoobo

Best AAAs: Gacha Gacha Cute Figu atto Mate [56], Song of the second moon [52], Musicmaker RX [52], Wish (Reprise) [51], Nyanyanyanyanyanyanya! [51], Exogenesis [51]
Quest for Scarhand: 3+ blackflags on Pure In Asia, blackflag on Iced Innocence
2020 update: all of these got bumped up 4 (rip Scarhand unlock), rusty, new AAA Power Rocket [56?]
2021 semiannual return: Connect (HOUSE SOUL REMIX) [57] (was blackflag from 2013), second blackflag on Call Upon the Seaponies; 2023: Polar 240 [56]
BFs: 127 and counting (as of 2013-11-10)
Viisbyxa is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 08:02 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright FlashFlashRevolution