Changeset 18982 for titan/plugins/tmdb


Ignore:
Timestamp:
12/08/12 03:49:20 (11 years ago)
Author:
obi
Message:

fix manual imdb scan

File:
1 edited

Legend:

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

    r18969 r18982  
    173173//flag1: 2 = save pic in mediadb path
    174174//flag2: 2 = save no pic
    175 struct tmdb* gettmdb(struct tmdb** first, char* title, int flag, int flag1)
     175struct tmdb* gettmdb(struct tmdb** first, char* input, int flag, int flag1)
    176176{
     177        debug(133, "title: %s",input);
     178        debug(133, "flag: %d",flag);
     179        debug(133, "flag1: %d",flag1);
     180       
    177181        struct tmdb* tnode = NULL;
    178         char* tmpstr = NULL, *tmpstr1 = NULL, *logdir = NULL, *logfile = NULL, *tmpsearch = NULL, *savefile = NULL, *timen = NULL, *log = NULL, *posterurl = NULL;
     182        char* tmpstr = NULL, *tmpstr1 = NULL, *logdir = NULL, *logfile = NULL, *tmpsearch = NULL, *savefile = NULL, *timen = NULL, *log = NULL, *posterurl = NULL, *title = NULL;
     183
     184        title = ostrcat(title, input, 1, 0);
    179185
    180186        int count = 0;
     
    193199        tmpsearch = ostrcat(tmpsearch, title, 1, 0);
    194200        tmpsearch = stringreplacechar(tmpsearch, ' ', '+');
    195 
     201printf("11111\n");
    196202        debug(133, "search: http://api.themoviedb.org/%s", tmpsearch);
    197203        tmpstr = gethttp("api.themoviedb.org", tmpsearch, 80, NULL, NULL, NULL, 0);
     
    389395                                }
    390396                        }
     397printf("22222\n");
    391398
    392399                        if((flag1 == 1 && tnode->backdrop != NULL && tnode->imdbid != NULL) || (flag1 == 2 && tnode->backdrop != NULL && tnode->imdbid != NULL))
     
    751758                                }
    752759                        }
     760printf("33333\n");
    753761                                       
    754762                        if(file_exist(tnode->mvi))
     
    763771                        tmpstr1 = ostrstr(tmpstr1, "<movie>");
    764772
    765                         free(tmpstr1), tmpstr1 = NULL;
     773// *** glibc detected *** /var/usr/local/share/titan/plugins/titan: free(): invalid pointer: 0x00a77a2b ***
     774//                      free(tmpstr1), tmpstr1 = NULL;
     775
    766776                        free(posterurl), posterurl = NULL;
    767777                        free(logdir), logdir = NULL;
     
    859869
    860870start:
     871                                printf("0000\n");
     872
    861873        if(node != NULL)
    862874        {
     
    901913                        if(search != NULL)
    902914                        {
    903                                 freetmdb(&node, 0); node = NULL;
     915                                freetmdb(&node, 0), node = NULL;
    904916                                drawscreen(blackscreen, 0, 0);
    905917                                drawscreen(load, 0, 0);
    906 
    907918                                node = gettmdb(&node, search, 0, 0);
    908919                                clearscreen(load);
    909920                                clearscreen(blackscreen);
    910                                 free(search); search = NULL;
     921                                free(search), search = NULL;
    911922                                goto start;
    912923                        }
     
    937948                                        clearscreen(load);
    938949                                        clearscreen(blackscreen);
    939                                         free(search); search = NULL;
     950                                        free(search), search = NULL;
    940951                                        freemenulist(mlist, 1); mlist = NULL, mbox = NULL;
    941952                                        goto start;
Note: See TracChangeset for help on using the changeset viewer.