Changeset 24429 for titan/plugins/tithek


Ignore:
Timestamp:
10/19/13 12:35:20 (10 years ago)
Author:
nit
Message:

[titan] optimize movie4k

File:
1 edited

Legend:

Unmodified
Added
Removed
  • titan/plugins/tithek/movie4k.h

    r24427 r24429  
    5454int movie4k_search(struct skin* grid, struct skin* listbox, struct skin* countlabel, struct skin* load, char* link, char* title, char* searchstr, int flag)
    5555{
    56         int ret = 1;
     56        int ret = 1, maxlen = 0, bigpos = 0;
    5757        int incount = 0;
    5858        char* tmpstr = NULL;
     
    173173                                        else
    174174                                                lang = ostrcat(" (\?\?)", NULL, 0, 0);
    175                                         line = ostrcat(line, name, 1, 0);
    176 
    177                                         line = ostrcat(line, lang, 1, 0);
    178                                         line = ostrcat(line, "#http://www.movie4k.to/", 1, 0);
    179                                         line = ostrcat(line, link, 1, 0);
    180                                         line = ostrcat(line, "#", 1, 0);
    181                                         line = ostrcat(line, pic, 1, 0);
    182                                         line = ostrcat(line, "#movie4k_search_", 1, 0);
    183                                         line = ostrcat(line, oitoa(incount + time(NULL)), 1, 1);
    184                                         line = ostrcat(line, ".jpg#Movie4k - Search#", 1, 0);
    185                                         line = ostrcat(line, type, 1, 0);
    186                                         line = ostrcat(line, "\n", 1, 0);
     175                                       
     176                                        ostrcatbig(&line, name, &maxlen, &bigpos);
     177                                        ostrcatbig(&line, lang, &maxlen, &bigpos);
     178                                        ostrcatbig(&line, "#http://www.movie4k.to/", &maxlen, &bigpos);
     179                                        ostrcatbig(&line, link, &maxlen, &bigpos);
     180                                        ostrcatbig(&line, "#", &maxlen, &bigpos);
     181                                        ostrcatbig(&line, pic, &maxlen, &bigpos);
     182                                        ostrcatbig(&line, "#movie4k_search_", &maxlen, &bigpos);
     183                                        char* cincount = oitoa(incount + time(NULL));
     184                                        ostrcatbig(&line, cincount, &maxlen, &bigpos);
     185                                        free(cincount); cincount = NULL;
     186                                        ostrcatbig(&line, ".jpg#Movie4k - Search#", &maxlen, &bigpos);
     187                                        ostrcatbig(&line, type, &maxlen, &bigpos);
     188                                        ostrcatbig(&line, "\n", &maxlen, &bigpos); 
     189
    187190                                        free(str), str = NULL;
    188191                                                                                       
     
    208211                        menu = ostrcat("/tmp/tithek/movie4k.search.list", NULL, 0, 0);
    209212                        writesys(menu, line, 0);
     213                        free(line); line = NULL;
     214                       
    210215                        struct tithek* tnode = (struct tithek*)listbox->select->handle;
    211216                        createtithek(tnode, tnode->title,  menu, tnode->pic, tnode->localname, tnode->menutitle, tnode->flag);
     
    403408                                                ostrcatbig(&line, ")", &maxlen, &bigpos);                                       
    404409                                        }
    405                                         ostrcatbig(&line, "#", &maxlen, &bigpos);
    406                                         ostrcatbig(&line, "http://www.movie4k.to/", &maxlen, &bigpos);
     410                                        ostrcatbig(&line, "#http://www.movie4k.to/", &maxlen, &bigpos);
    407411                                        ostrcatbig(&line, url, &maxlen, &bigpos);
    408                                         ostrcatbig(&line, "#", &maxlen, &bigpos);
    409                                         ostrcatbig(&line, "http://atemio.dyndns.tv/mediathek/menu/", &maxlen, &bigpos);
     412                                        ostrcatbig(&line, "#http://atemio.dyndns.tv/mediathek/menu/", &maxlen, &bigpos);
    410413                                        ostrcatbig(&line, pichname, &maxlen, &bigpos);
    411414                                        ostrcatbig(&line, ".jpg#movie4k_", &maxlen, &bigpos);
     
    435438                                                        ostrcatbig(&line, ")", &maxlen, &bigpos);                                       
    436439                                                }
    437                                                 ostrcatbig(&line, "#", &maxlen, &bigpos);
    438                                                 ostrcatbig(&line, "http://www.movie4k.to/", &maxlen, &bigpos);
     440                                                ostrcatbig(&line, "#http://www.movie4k.to/", &maxlen, &bigpos);
    439441                                                ostrcatbig(&line, url2, &maxlen, &bigpos);
    440                                                 ostrcatbig(&line, "#", &maxlen, &bigpos);
    441                                                 ostrcatbig(&line, "http://atemio.dyndns.tv/mediathek/menu/", &maxlen, &bigpos);
     442                                                ostrcatbig(&line, "#http://atemio.dyndns.tv/mediathek/menu/", &maxlen, &bigpos);
    442443                                                ostrcatbig(&line, pichname, &maxlen, &bigpos);
    443444                                                ostrcatbig(&line, ".jpg#kinox_", &maxlen, &bigpos);
     
    467468                                                        ostrcatbig(&line, ")", &maxlen, &bigpos);                                       
    468469                                                }
    469                                                 ostrcatbig(&line, "#", &maxlen, &bigpos);
    470                                                 ostrcatbig(&line, "http://www.movie4k.to/", &maxlen, &bigpos);
     470                                                ostrcatbig(&line, "#http://www.movie4k.to/", &maxlen, &bigpos);
    471471                                                ostrcatbig(&line, url3, &maxlen, &bigpos);
    472                                                 ostrcatbig(&line, "#", &maxlen, &bigpos);
    473                                                 ostrcatbig(&line, "http://atemio.dyndns.tv/mediathek/menu/", &maxlen, &bigpos);
     472                                                ostrcatbig(&line, "#http://atemio.dyndns.tv/mediathek/menu/", &maxlen, &bigpos);
    474473                                                ostrcatbig(&line, pichname, &maxlen, &bigpos);
    475474                                                ostrcatbig(&line, ".jpg#movie4k_", &maxlen, &bigpos);
     
    499498                                                        ostrcatbig(&line, ")", &maxlen, &bigpos);                                       
    500499                                                }
    501                                                 ostrcatbig(&line, "#", &maxlen, &bigpos);
    502                                                 ostrcatbig(&line, "http://www.movie4k.to/", &maxlen, &bigpos);
     500                                                ostrcatbig(&line, "#http://www.movie4k.to/", &maxlen, &bigpos);
    503501                                                ostrcatbig(&line, url4, &maxlen, &bigpos);
    504                                                 ostrcatbig(&line, "#", &maxlen, &bigpos);
    505                                                 ostrcatbig(&line, "http://atemio.dyndns.tv/mediathek/menu/", &maxlen, &bigpos);
     502                                                ostrcatbig(&line, "#http://atemio.dyndns.tv/mediathek/menu/", &maxlen, &bigpos);
    506503                                                ostrcatbig(&line, pichname, &maxlen, &bigpos);
    507504                                                ostrcatbig(&line, ".jpg#movie4k_", &maxlen, &bigpos);
     
    559556        debug(99, "link: %s", link);
    560557        int debuglevel = getconfigint("debuglevel", NULL);
    561         int ret = 1, series = 0;
     558        int ret = 1, series = 0, maxlen = 0, bigpos = 0;
    562559        char* ip = NULL, *pos = NULL, *id = NULL, *tpath = NULL, *path = NULL, *tmpstr = NULL, *line = NULL, *episode = NULL;
    563560        char* from = NULL;
     
    643640
    644641                                                        incount += 1;
    645                                                         line = ostrcat(line, _("Season"), 1, 0);
    646                                                         line = ostrcat(line, " ", 1, 0);
    647                                                         line = ostrcat(line, oitoa(i), 1, 0);
    648                                                         line = ostrcat(line, " ", 1, 0);
    649                                                         line = ostrcat(line, _("Episode"), 1, 0);
    650                                                         line = ostrcat(line, " ", 1, 0);
    651 //                                                      line = ostrcat(line, oitoa(j), 1, 0);
    652                                                         line = ostrcat(line, episode, 1, 0);                                   
    653                                                         line = ostrcat(line, "#", 1, 0);
    654                                                         line = ostrcat(line, "http://www.movie4k.to/", 1, 0);
    655                                                         line = ostrcat(line, link, 1, 0);
    656                                                         line = ostrcat(line, "#", 1, 0);
    657                                                         line = ostrcat(line, "http://atemio.dyndns.tv/mediathek/menu/s", 1, 0);
    658                                                         line = ostrcat(line, oitoa(i), 1, 0);
    659                                                         line = ostrcat(line, "e", 1, 0);
    660 //                                                      line = ostrcat(line, oitoa(j), 1, 0);
    661                                                         line = ostrcat(line, episode, 1, 0);
    662                                                         line = ostrcat(line, ".jpg", 1, 0);                                                                                                                             
    663                                                         line = ostrcat(line, "#movie4k_search_", 1, 0);
    664                                                         line = ostrcat(line, oitoa(i), 1, 0);
    665                                                         line = ostrcat(line, "e", 1, 0);
    666 //                                                      line = ostrcat(line, oitoa(j), 1, 0);
    667                                                         line = ostrcat(line, episode, 1, 0);
    668                                                         line = ostrcat(line, ".jpg#Movie4k - ", 1, 0);
    669                                                         line = ostrcat(line, title, 1, 0);
    670                                                         line = ostrcat(line, "#34\n", 1, 0);
    671                                                         free(id), id = NULL;
    672                                                         free(episode), episode = NULL;
     642                                                       
     643                                                        char* ci = oitoa(i);
     644//                                                      char* cj = oitoa(j);
     645                                                        ostrcatbig(&line, _("Season"), &maxlen, &bigpos);
     646                                                        ostrcatbig(&line, " ", &maxlen, &bigpos);
     647                                                        ostrcatbig(&line, ci, &maxlen, &bigpos);
     648                                                        ostrcatbig(&line, " ", &maxlen, &bigpos);
     649                                                        ostrcatbig(&line, _("Episode"), &maxlen, &bigpos);
     650                                                        ostrcatbig(&line, " ", &maxlen, &bigpos);                                                       
     651//                                                      ostrcatbig(&line, cj, &maxlen, &bigpos);
     652                                                        ostrcatbig(&line, episode, &maxlen, &bigpos);
     653                                                        ostrcatbig(&line, "#http://www.movie4k.to/", &maxlen, &bigpos);
     654                                                        ostrcatbig(&line, link, &maxlen, &bigpos);
     655                                                        ostrcatbig(&line, "#http://atemio.dyndns.tv/mediathek/menu/s", &maxlen, &bigpos);
     656                                                        ostrcatbig(&line, ci, &maxlen, &bigpos);
     657                                                        ostrcatbig(&line, "e", &maxlen, &bigpos);
     658//                                                      ostrcatbig(&line, cj, &maxlen, &bigpos);
     659                                                        ostrcatbig(&line, episode, &maxlen, &bigpos);
     660                                                        ostrcatbig(&line, ".jpg#movie4k_search_", &maxlen, &bigpos);
     661                                                        ostrcatbig(&line, ci, &maxlen, &bigpos);
     662                                                        ostrcatbig(&line, "e", &maxlen, &bigpos);
     663//                                                      ostrcatbig(&line, cj, &maxlen, &bigpos);
     664                                                        ostrcatbig(&line, episode, &maxlen, &bigpos);
     665                                                        ostrcatbig(&line, ".jpg#Movie4k - ", &maxlen, &bigpos);
     666                                                        ostrcatbig(&line, title, &maxlen, &bigpos);
     667                                                        ostrcatbig(&line, "#34\n", &maxlen, &bigpos);
     668
     669                                                        free(id); id = NULL;
     670                                                        free(episode); episode = NULL;
     671                                                        free(ci); ci = NULL;
     672//                                              free(cj); cj = NULL;
    673673                                                }
    674674                                        }
     
    692692
    693693                titheklog(debuglevel, "/tmp/movie4k8_line", NULL, line);
     694                free(line); line = NULL;
    694695                                       
    695696                struct tithek* tnode = (struct tithek*)listbox->select->handle;
     
    704705        debug(99, "link: %s", link);
    705706        int debuglevel = getconfigint("debuglevel", NULL);
    706         int ret = 1;
     707        int ret = 1, maxlen = 0, bigpos = 0;
    707708        char* ip = NULL, *pos = NULL, *tpath = NULL, *path = NULL, *tmpstr = NULL, *line = NULL;
    708709        char* from = NULL;
     
    767768                                        debug(99, "(S%s) input: %s%s",season, name, lang);
    768769
    769                                         line = ostrcat(line, _("Season"), 1, 0);
    770                                         line = ostrcat(line, " ", 1, 0);
    771                                         line = ostrcat(line, season, 1, 0);
    772                                         line = ostrcat(line, " ", 1, 0);
    773                                                                                
    774                                         line = ostrcat(line, lang, 1, 0);       
    775                                         line = ostrcat(line, "#", 1, 0);
    776                                         line = ostrcat(line, "http://www.movie4k.to/", 1, 0);
    777                                         line = ostrcat(line, link, 1, 0);
    778                                         line = ostrcat(line, "#", 1, 0);
    779                                         line = ostrcat(line, "http://atemio.dyndns.tv/mediathek/menu/s", 1, 0);
    780                                         line = ostrcat(line, season, 1, 0);
    781                                         line = ostrcat(line, ".jpg", 1, 0);
    782                                         line = ostrcat(line, "#s", 1, 0);
    783                                         line = ostrcat(line, season, 1, 0);
    784                                         line = ostrcat(line, ".jpg", 1, 0);
    785                                         line = ostrcat(line, "#Movie4k - ", 1, 0);
    786                                         line = ostrcat(line, title, 1, 0);
    787                                         line = ostrcat(line, "#39\n", 1, 0);
     770          ostrcatbig(&line, _("Season"), &maxlen, &bigpos);
     771          ostrcatbig(&line, " ", &maxlen, &bigpos);
     772          ostrcatbig(&line, season, &maxlen, &bigpos);
     773          ostrcatbig(&line, " ", &maxlen, &bigpos);
     774         
     775          ostrcatbig(&line, lang, &maxlen, &bigpos);
     776          ostrcatbig(&line, "#http://www.movie4k.to/", &maxlen, &bigpos);
     777          ostrcatbig(&line, link, &maxlen, &bigpos);
     778          ostrcatbig(&line, "#http://atemio.dyndns.tv/mediathek/menu/s", &maxlen, &bigpos);
     779          ostrcatbig(&line, season, &maxlen, &bigpos);
     780          ostrcatbig(&line, ".jpg#s", &maxlen, &bigpos);
     781          ostrcatbig(&line, season, &maxlen, &bigpos);
     782          ostrcatbig(&line, ".jpg#Movie4k - ", &maxlen, &bigpos);
     783          ostrcatbig(&line, title, &maxlen, &bigpos);
     784          ostrcatbig(&line, "#39\n", &maxlen, &bigpos);
     785
    788786                                        free(name), name = NULL;
    789787                                        free(lang), lang = NULL;
     
    805803
    806804                titheklog(debuglevel, "/tmp/movie4k8_line", NULL, line);
     805                free(line); line = NULL;
    807806                                       
    808807                struct tithek* tnode = (struct tithek*)listbox->select->handle;
     
    817816        debug(99, "link: %s", link);
    818817        int debuglevel = getconfigint("debuglevel", NULL);
    819         int ret = 1;
     818        int ret = 1, maxlen = 0, bigpos = 0;
    820819        char* ip = NULL, *pos = NULL, *tpath = NULL, *path = NULL, *tmpstr = NULL, *line = NULL;
    821820        char* from = NULL;
     
    882881                                        debug(99, "(S%s/E%s) input: %s%s",season, episode, name, lang);
    883882
    884                                         line = ostrcat(line, _("Season"), 1, 0);
    885                                         line = ostrcat(line, " ", 1, 0);
    886                                         line = ostrcat(line, season, 1, 0);
    887                                         line = ostrcat(line, " ", 1, 0);
    888                                         line = ostrcat(line, _("Episode"), 1, 0);
    889                                         line = ostrcat(line, " ", 1, 0);                               
    890                                         line = ostrcat(line, episode, 1, 0);
    891                                         line = ostrcat(line, " ", 1, 0);
    892                                         line = ostrcat(line, lang, 1, 0);       
    893                                         line = ostrcat(line, "#", 1, 0);
    894                                         line = ostrcat(line, "http://www.movie4k.to/", 1, 0);
    895                                         line = ostrcat(line, link, 1, 0);
    896                                         line = ostrcat(line, "#", 1, 0);
    897                                         line = ostrcat(line, "http://atemio.dyndns.tv/mediathek/menu/s", 1, 0);
    898                                         line = ostrcat(line, season, 1, 0);
    899                                         line = ostrcat(line, "e", 1, 0);
    900                                         line = ostrcat(line, episode, 1, 0);
    901                                         line = ostrcat(line, ".jpg", 1, 0);
    902                                         line = ostrcat(line, "#s", 1, 0);
    903                                         line = ostrcat(line, season, 1, 0);
    904                                         line = ostrcat(line, "e", 1, 0);
    905                                         line = ostrcat(line, episode, 1, 0);
    906                                         line = ostrcat(line, ".jpg", 1, 0);
    907                                         line = ostrcat(line, "#Movie4k - ", 1, 0);
    908                                         line = ostrcat(line, title, 1, 0);
    909                                         line = ostrcat(line, "#34\n", 1, 0);
     883          ostrcatbig(&line, _("Season"), &maxlen, &bigpos);
     884          ostrcatbig(&line, " ", &maxlen, &bigpos);
     885          ostrcatbig(&line, season, &maxlen, &bigpos);
     886          ostrcatbig(&line, " ", &maxlen, &bigpos);
     887          ostrcatbig(&line, _("Episode"), &maxlen, &bigpos);
     888          ostrcatbig(&line, " ", &maxlen, &bigpos);
     889          ostrcatbig(&line, episode, &maxlen, &bigpos);
     890          ostrcatbig(&line, " ", &maxlen, &bigpos);
     891          ostrcatbig(&line, lang, &maxlen, &bigpos);
     892          ostrcatbig(&line, "#http://www.movie4k.to/", &maxlen, &bigpos);
     893          ostrcatbig(&line, link, &maxlen, &bigpos);
     894          ostrcatbig(&line, "#http://atemio.dyndns.tv/mediathek/menu/s", &maxlen, &bigpos);
     895          ostrcatbig(&line, season, &maxlen, &bigpos);
     896          ostrcatbig(&line, "e", &maxlen, &bigpos);
     897          ostrcatbig(&line, episode, &maxlen, &bigpos);
     898          ostrcatbig(&line, ".jpg#s", &maxlen, &bigpos);
     899          ostrcatbig(&line, season, &maxlen, &bigpos);
     900          ostrcatbig(&line, "e", &maxlen, &bigpos);
     901          ostrcatbig(&line, episode, &maxlen, &bigpos);
     902          ostrcatbig(&line, ".jpg#Movie4k - ", &maxlen, &bigpos);
     903          ostrcatbig(&line, title, &maxlen, &bigpos);
     904                                        ostrcatbig(&line, "#34\n", &maxlen, &bigpos);
     905
    910906                                        free(name), name = NULL;
    911907                                        free(lang), lang = NULL;
     
    928924
    929925                titheklog(debuglevel, "/tmp/movie4k8_line", NULL, line);
     926                free(line); line = NULL;
    930927                                       
    931928                struct tithek* tnode = (struct tithek*)listbox->select->handle;
Note: See TracChangeset for help on using the changeset viewer.