Sign up here and you can log into the forum!

Plugin: MediaMark [internal] (WDLXTV 0.4.5.1+)

The WDTVExt plugin depot. Plugins/libraries/code only

Re: Plugin: MediaMark [internal] (WDLXTV 0.4.5.1+)   

Postby txemix » Tue Jan 18, 2011 2:30 pm

I noticed MediaMark (internal) fails when filename (or folder) has a quote (e.g. Grey's Anatomy), otherwise it's really great having it integrated to WDLXTV. (By the way, to bad we cannot have also a lite version of MediaNavigation, I think in-file navigation would be enough.)
txemix
Donor
 
Posts: 32
Joined: Fri Apr 16, 2010 2:00 pm

Re: Plugin: MediaMark [internal] (WDLXTV 0.4.5.1+)   

Postby monkmad » Fri Jan 21, 2011 4:36 am

@recliq: I see in SVN, that you are moving to a DB (sqlite) based implementation for MediaMark. I think it is a step in the right direction. Also noticed that you provided a script to import the old log file into the database, good stuff. I'd like to test this feature out; are the changes ready to be taken out for a spin, or are there any other commits still waiting?
monkmad
Beta Tester
 
Posts: 96
Joined: Tue Apr 20, 2010 11:31 pm

Re: Plugin: MediaMark [internal] (WDLXTV 0.4.5.1+)   

Postby recliq » Fri Jan 21, 2011 5:52 am

basically it's working, check out mm2db.pl in MediaMark dir...
I made a couple of changes to that yesterday, the one in svn still uses hardcoded files and some wrong paths... i guess you will figure it out ;)
will commit enhanced version soon (along with some webinterface for importing/exporting mediaMark.log file)

EDIT: updated SVn with latest version of mm2db.pl ;)
­WDLXTV Project Maintainer
-:] If you like my contributions feel free to donate for a beer or a new flash drive. ...and always remember: RTFM! (README, FAQ, WIKI) [:-
User avatar
recliq
WDLXTV Team
 
Posts: 5513
Joined: Thu Apr 15, 2010 8:09 am
Location: Kiel, Germany

Re: Plugin: MediaMark [internal] (WDLXTV 0.4.5.1+)   

Postby monkmad » Fri Jan 21, 2011 8:51 am

I was eager and tested it before you posted the new mm2db.pl :mrgreen:

Initial verdict is that the import seems to work; though you want to add some some error handling for those lines in the old mediaMark.log file which are invalid. They usually have the word "error" somewhere in them. Left unchecked, they insert garbage data in the hash column which looks like "ERROR opening file umsp://plugins/apple-trailers/apple-trailers..."
You can also check after importing with something like
Code: Select all
select * from mediamark where hash like "error%";


It should not affect functionality, but I think its better if things are clean. :)

Now, rather than telling you about errors and asking for a fix, I thought why not write the fix myself? It's just a couple of lines. I don't have access to SVN or the ability to attach files with posts, so pasting modified code below. This is for the latest mm2db.pl (from SVN), starting from line #78. Hope it helps.
(As usual, please test before committing )

Code: Select all
   my $COUNT = 0;
   my $ERR_RECORDS = 0;
   my $IMPORTED = 0;
    $BROWSER eq "true" and print "importing hashes, please wait...";
    while (<FILE>) {
        chomp($_);
#    print "$_\n";
        my @HASH = split(/;/, $_);
        my $HASH = $HASH[0];
        if (index(lc($HASH[0]),"error") >= 0) {
            if ($DEBUG eq "true") {
            print "Error found in log file. Skipping record # $COUNT ...\n";
            }
            $COUNT++;
            $ERR_RECORDS++;
           next;       
        }
        if ($DEBUG eq "true") {
            print "\nhash: $HASH";
        }
        my $CMD = "insert into mediamark (hash, time) values ('$HASH', strftime('%s','now'))";
        if ($DRY eq "true") {
            print "\n sql: $CMD\n";
        } else {
             &sql("$CMD");
        }
        $COUNT++;
        if ($BROWSER ne "true") {
            $IMPORTED = $COUNT - $ERR_RECORDS;
            printf("\rinserted %d hashes out of a total %d records\t", $IMPORTED, $COUNT);
        }
    }
    if ($BROWSER eq "true") {
        printf("\ninserted %d hashes\n", $IMPORTED);
    } else {
        if ($COUNT > 0) { print "[ ok ]"; }
        print "\n";
    }
    close(FILE);


I'll post more feedback when I'm near the box and can test the OSD.
monkmad
Beta Tester
 
Posts: 96
Joined: Tue Apr 20, 2010 11:31 pm

Re: Plugin: MediaMark [internal] (WDLXTV 0.4.5.1+)   

Postby recliq » Fri Jan 21, 2011 10:07 am

you are right, there's no error handling for the .log yet, i cleaned it out by hand... :oops: (and tried to avoid inserting error strings in mediamark)
i'll work on both on the weekend.. ;)

EDIT: Having a look at your code... how about only two lines and have even stricter checking...
Code: Select all
if ($HASH =~ /^\w{16}$/) {

}

around the insert code. :mrgreen: :geek:

EDIT 2: maybe you're also intrested in this 8-)
­WDLXTV Project Maintainer
-:] If you like my contributions feel free to donate for a beer or a new flash drive. ...and always remember: RTFM! (README, FAQ, WIKI) [:-
User avatar
recliq
WDLXTV Team
 
Posts: 5513
Joined: Thu Apr 15, 2010 8:09 am
Location: Kiel, Germany

Re: Plugin: MediaMark [internal] (WDLXTV 0.4.5.1+)   

Postby monkmad » Fri Jan 21, 2011 1:49 pm

Yeah, you are right; much simpler. Most of my code was around catching and logging the error statements; which an end user won't care about. :D

As for your other link, I don't have access to that forum yet.
monkmad
Beta Tester
 
Posts: 96
Joined: Tue Apr 20, 2010 11:31 pm

Re: Plugin: MediaMark [internal] (WDLXTV 0.4.5.1+)   

Postby recliq » Sat Jan 22, 2011 2:52 am

try again now... ;) you should have access now.
­WDLXTV Project Maintainer
-:] If you like my contributions feel free to donate for a beer or a new flash drive. ...and always remember: RTFM! (README, FAQ, WIKI) [:-
User avatar
recliq
WDLXTV Team
 
Posts: 5513
Joined: Thu Apr 15, 2010 8:09 am
Location: Kiel, Germany

Re: Plugin: MediaMark [internal] (WDLXTV 0.4.5.1+)   

Postby gpica » Sun Jan 23, 2011 9:14 am

hello
didn't find a place where to post this issue about MM internal: hope here is ok

my MM is enabled and seems it's working: in .log file i can see listed the "checked as seen" movies.
the only problem is that i can't see the checkmark in the sheet (list or wall, either)

i have to say that i modified the xml of those sheets, there is something i could check on them? any tag that reports the position of the checkmark?

thanks in advance
g.
gpica
WDTVer
 
Posts: 23
Joined: Sat Jun 19, 2010 3:55 pm

Re: Plugin: MediaMark [internal] (WDLXTV 0.4.5.1+)   

Postby gpica » Sun Jan 23, 2011 10:16 am

gpica wrote:hello
didn't find a place where to post this issue about MM internal: hope here is ok

my MM is enabled and seems it's working: in .log file i can see listed the "checked as seen" movies.
the only problem is that i can't see the checkmark in the sheet (list or wall, either)

i have to say that i modified the xml of those sheets, there is something i could check on them? any tag that reports the position of the checkmark?

thanks in advance
g.


(quoting myself) - SOLVED

ok, found it
i just modified my xml for wall and list mode and introduced ckeckMark.png in my custom OSD
thanks anyway
gpica
WDTVer
 
Posts: 23
Joined: Sat Jun 19, 2010 3:55 pm

Re: Plugin: MediaMark [internal] (WDLXTV 0.4.5.1+)   

Postby RavRob » Mon Jan 24, 2011 1:29 pm

Is there an updated download link somewhere? Or I need to patch the *.js myself? Or what other options?

Thanks
Windows 10
WDTV Live
1.02.21 WDLXTV 0.5.1.4 (Beta)
Linksys - WUSB600N USB Adapter
DLink - Dir-655 Router
Atheros - AR8131 PCI-E Gigabit Ethernet Controller (NDIS 6.20)
Kodi - The Future of Television
User avatar
RavRob
Supporter
 
Posts: 1398
Joined: Fri Apr 16, 2010 9:57 am
Location: New-Brunswick, Canada

PreviousNext

Return to WDTVExt plugins

Who is online

Users browsing this forum: No registered users and 2 guests