Author Topic: HOW TO: Set up Decades for fast browsing  (Read 4413 times)

Offline Barcrest

  • Developer and Head Honcho.
  • Administrator
  • Hero Member
  • *****
  • Posts: 13450
  • Fu: +92/-5
  • Grooooooooovy!
HOW TO: Set up Decades for fast browsing
« on: July 07, 2009, 11:20:56 PM »
What is it?
If you have a large library you may notice a small amount of lag when browsing the decades charts. This isn't really a show stopper but it is a pain when going to various dates. You can make it changing the dates almost instant by following this Guide.

How To?
When you installed E-Touch you will see there is an app called decades builder. What this does is go through every month and year for a selected chart and build a second set of files that already contain the information about the tracks you have and so a search isn't requires for each track in that month/year combo.

Launch Decades Builder and pick the chart you want to do this for, specify the date range and then click on Audio, Video or Karaoke to build the required set of PRE files. You can specify exact match if you are confident the decades names match your tags.

Additional:
Sometimes it will make mistakes and match up to the wrong track. If you go into the USER DECADES folder in the E-Touch install directory you can edit the corrisponding PRE file to point it to the correct file.

So what are you waiting for...
« Last Edit: July 07, 2009, 11:26:16 PM by Barcrest »
Keep on Rocking in the Free World \m/ ;D\m/



Jukebox Stats...

Offline Novalak

  • Freebox Lifetime Supporter
  • Hero Member
  • ********
  • Posts: 682
  • Fu: +0/-0
Re: HOW TO: Set up Decades for fast browsing
« Reply #1 on: July 09, 2009, 03:53:54 AM »
Once you have your PRE files built, I have a perl script to check what songs im missing

You will need to install active perl from http://www.activestate.com/activeperl/

In the C:\Program Files\E-Touch Jukebox\User Decades\<chart>\Audio directory, create a txt file with the following...



my %output = ();
foreach my $file (glob "*/*.pre")
{
        open F, "<$file" or die "cannot open $file";
        while (my $line = <F>)
        {
           $output{$line++} = $line if ($line =~ /",.,""\s*$/);
        }
        close F;
        print "$file processed", "\n"
}

open G, ">output.txt" or die "cannot open output.txt";
foreach my $elem (sort keys %output)
{
   $elem =~ s/^"//;
   $elem =~ s/","/ - /g;
   $elem =~ s/",.,""//;
   print G $elem;
}
close G;





Then save the txt file and rename to missing.pl

Now double click on missing.pl and it creates an output.txt file with all the songs its missing

Something like this...


Andy Stewart - Donald Where's Your Troosers
Andy Stewart - The Battle's O'er (Soldier Laddie)
Andy Williams - (Where Do I Begin) Love Story
Andy Williams - Butterfly
Andy Williams - Can't Get Used To Losing You
Andy Williams - The Village Of St Bernadette


The script removes duplicates from the list

Offline Barcrest

  • Developer and Head Honcho.
  • Administrator
  • Hero Member
  • *****
  • Posts: 13450
  • Fu: +92/-5
  • Grooooooooovy!
Re: HOW TO: Set up Decades for fast browsing
« Reply #2 on: July 09, 2009, 11:30:48 AM »
I have never looked at pearl but i think i can see how that works. Would this be a feature you would like adding to the decades builder? Also how about an update feature for the decades builder that just looks for the ones that were missing and adds those?
Keep on Rocking in the Free World \m/ ;D\m/



Jukebox Stats...

Offline Novalak

  • Freebox Lifetime Supporter
  • Hero Member
  • ********
  • Posts: 682
  • Fu: +0/-0
Re: HOW TO: Set up Decades for fast browsing
« Reply #3 on: July 09, 2009, 11:30:37 PM »
i dont mind, tell me what you want and ill have it written. Im personally not a perl writer but the guy at work loves it, and i tell him what i need and he creates it in 2 minutes

i have plenty of little scripts i used to build my decades

for instance

the first week of the month i go to http://australian-charts.com/weekchart.asp?cat=s
and grab the top 10 which is formatted like this...

1   1      The Black Eyed Peas
I Gotta Feeling   UMA   4
2   3      Lady GaGa
Paparazzi   INR/UMA   5
3         Michael Jackson
Thriller   SME   1
4   7      Linkin Park
New Divide   WARNER   6
5   2      The Black Eyed Peas
Boom Boom Pow   INR/UMA   14
6   RE      Michael Jackson
Black Or White   SME   18
7         Michael Jackson
Billie Jean   SME   1
8         Michael Jackson
Man In The Mirror   EPI/SME   1
9   4      Lily Allen
Not Fair   CAP/EMI   13
10   5      Taylor Swift
You Belong With Me   UMA   8

i then save it in a txt file and run this perl



die "Require 1 argument only! $0 <inputfile> > <outputfile>\n" unless (scalar @ARGV == 1);
my $inputfile = $ARGV[0];
my @arr = ();

open F, "<$inputfile" or die "Cannot open file: $inputfile\n";

while (my $line = <F>)
{
   chomp $line;
   my @fields = split(/\t/, $line);
   if ($line =~ /^\d/)
   {
      push @arr, "\"$fields[3]\"";
   }
   else
   {
      push @arr, ",\"$fields[0]\"";
   }
}
close F;

open G, ">$inputfile" or die "Cannot write to file: $inputfile\n";
while (my $line = shift(@arr))
{
   print G $line;
   print G ",\n" if ($line =~ /^\,/);
}
close G;




i run aria.pl 07.txt

it turns it into

"The Black Eyed Peas","I Gotta Feeling",.
"Lady GaGa","Paparazzi",.
"Michael Jackson","Thriller",.
"Linkin Park","New Divide",.
"The Black Eyed Peas","Boom Boom Pow",.
"Michael Jackson","Black Or White",.
"Michael Jackson","Billie Jean",.
"Michael Jackson","Man In The Mirror",.
"Lily Allen","Not Fair",.
"Taylor Swift","You Belong With Me",.



i have another one to work out the up and down...but i dont like having this displayed personally

Offline Barcrest

  • Developer and Head Honcho.
  • Administrator
  • Hero Member
  • *****
  • Posts: 13450
  • Fu: +92/-5
  • Grooooooooovy!
Re: HOW TO: Set up Decades for fast browsing
« Reply #4 on: October 20, 2013, 12:59:53 PM »
With the improved search routines the PRE files are not really a requirement anymore.
Keep on Rocking in the Free World \m/ ;D\m/



Jukebox Stats...