Ignore:
Timestamp:
11/19/12 18:41:31 (11 years ago)
Author:
obi
Message:

[titan] imdb fix alternative output

File:
1 edited

Legend:

Unmodified
Added
Removed
  • titan/plugins/imdb/imdb.h

    r18528 r18660  
    4141       
    4242start:
     43        debug(133, "title: %s",title);
    4344        tmpsearch = ostrcat("find?s=tt;q=", NULL, 0, 0);
    4445        if(flag == 0)
    4546                tmpsearch = ostrcat(tmpsearch, title, 1, 0);
    4647        else
    47                 tmpsearch = ostrcat(tmpsearch, "/title/tt", 1, 0);
     48                tmpsearch = ostrcat("/title/tt", title, 0, 0);
    4849        tmpsearch = stringreplacechar(tmpsearch, ' ', '+');
    4950
     
    9697                        tmpstr = string_resub("<p><b>Titel", "</td></tr></table> </p>", tmpstr, 0);
    9798                        free(tmp); tmp = NULL;
     99//                      writesys("/var/usr/local/share/titan/plugins/imdb/tmpstr", tmpstr, 0);
    98100                       
    99101                        while(ostrstr(tmpstr, "</td><td valign=\"top\"><a href=\"/title/") != NULL)
     
    101103                                tmpstr = string_replace("</td><td valign=\"top\"><a href=\"/title/", "\n\n", tmpstr, 1);
    102104                        }
     105//                      writesys("/var/usr/local/share/titan/plugins/imdb/tmpstr1", tmpstr, 0);
    103106
    104107                        struct menulist* mlist = NULL, *mbox = NULL;
     
    113116                        for(i = 0; i < max; i++)
    114117                        {
    115                                 tmpstr1 = string_resub("link=/title", "</a>", (&ret[i])->part, 0);
     118//                              tmpstr1 = string_resub("link=/title", "</a>", (&ret[i])->part, 0);
     119                                tmpstr1 = string_resub("link=/title", "</td>", (&ret[i])->part, 0);
     120                                debug(133, "tmpstr1(%d): %s\n", i, tmpstr1);
     121                                tmpstr1 = string_replace("</a>", "", tmpstr1, 1);
     122                                debug(133, "tmpstr1(%d): %s\n", i, tmpstr1);
     123       
     124                                char* x = oregex("/tt([0-9]{7})", tmpstr1);
     125                                char* y = oregex(";\">(.*)", tmpstr1);
     126                                if(ostrstr(y, "<img src") == NULL && x != NULL && y != NULL)
     127                                {
     128                                        debug(133, "x(%d): %s\n", i, x);
     129                                        debug(133, "y(%d): %s\n", i, y);                               
     130                                        string_striptags(x);
     131                                        string_striptags(y);
     132                                        string_strip_whitechars(x);
     133                                        string_strip_whitechars(y);
     134                                        debug(133, "x(%d): %s\n", i, x);
     135                                        debug(133, "y(%d): %s\n", i, y);
     136                                        y = string_decode(y, 1);
     137                                        x = string_decode(x, 1);
     138                                        debug(133, "x(%d): %s\n", i, x);
     139                                        debug(133, "y(%d): %s\n", i, y);
     140
     141                                        addmenulist(&mlist, y, x, NULL, 0, 0);
     142                                }
     143                                free(x), x = NULL;
     144                                free(y), y = NULL;                             
     145/*                             
     146current not working
    116147                                struct regex* x = regexstruct("/tt([0-9]{7})", tmpstr1);
    117148                                struct regex* y = regexstruct(";\">(.*)", tmpstr1);
    118149                                if(x != NULL && y != NULL)
    119150                                {
     151                                        debug(133, "x->match2(%d): %s\n", i, x->match2);
     152                                        debug(133, "y->match2(%d): %s\n", i, y->match2);
    120153                                        x->match2 = string_decode(x->match2, 1);
    121154                                        y->match2 = string_decode(y->match2, 1);
     
    126159                                freeregexstruct(x); x = NULL;
    127160                                freeregexstruct(y); y = NULL;
    128 
     161*/
    129162                                free(tmpstr1),tmpstr1 = NULL;                           
    130163                        }
     
    417450void screenimdb(char* title)
    418451{
     452        debug(133, "title: %s",title);
    419453        int rcret = 0;
    420454        struct skin* imdbskin = getscreen("imdb");
     
    431465        char* search = NULL;
    432466
    433         setfbtransparent(255);
     467//      setfbtransparent(255);
    434468        status.hangtime = 99999;
    435469
    436470        if(title == NULL) title = getepgakttitle(NULL);
     471        debug(133, "title: %s",title);
    437472
    438473        drawscreen(load, 0, 0);
     
    464499                if(rcret == getrcconfigint("rcred", NULL))
    465500                {
    466                 search = textinput("Search", NULL);
    467                 if(search != NULL)
    468                 {
    469                         freeimdb(&node, 0); node = NULL;
    470                         drawscreen(load, 0, 0);
    471                         node = getimdb(&node, search, 0, 0, 0);
    472                         clearscreen(load);
    473                         free(search); search = NULL;
    474                         goto start;
    475                 }
    476                 drawscreen(imdbskin, 0, 0);
    477                 continue;
     501                        search = textinput("Search", NULL);
     502                        if(search != NULL)
     503                        {
     504                                freeimdb(&node, 0); node = NULL;
     505                                drawscreen(load, 0, 0);
     506                                node = getimdb(&node, search, 0, 0, 0);
     507                                clearscreen(load);
     508                                free(search); search = NULL;
     509                                goto start;
     510                        }
     511                        drawscreen(imdbskin, 0, 0);
     512                        continue;
    478513                }
    479514        }
    480515
    481516        freeimdb(&node, 0); node = NULL;
    482         setosdtransparent(getskinconfigint("osdtransparent", NULL));
     517//      setosdtransparent(getskinconfigint("osdtransparent", NULL));
    483518        status.hangtime = getconfigint("hangtime", NULL);
    484519        clearscreen(imdbskin);
Note: See TracChangeset for help on using the changeset viewer.