Changeset 16853


Ignore:
Timestamp:
06/26/12 21:01:50 (12 years ago)
Author:
nit
Message:

[titan] update mediadb/tmc

Location:
titan
Files:
4 edited

Legend:

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

    r16812 r16853  
    111111                                free((*first)->poster);
    112112                                (*first)->poster = savefile;
     113
    113114                                //create thumb
    114115                                savethumb = ostrcat(getconfig("mediadbpath", NULL), "/", 0, 0);
     
    120121                                        buf = savejpg(savethumb, width, height, channels, 91, 140, 70, buf);
    121122                                }
     123                                free(savethumb); savethumb = NULL;
     124                                free(buf); buf = NULL;
     125
     126                                //create xxxxx
     127                                savethumb = ostrcat(getconfig("mediadbpath", NULL), "/", 0, 0);
     128                                savethumb = ostrcat(savethumb, (*first)->id, 1, 0);
     129                                savethumb = ostrcat(savethumb, "_xxxx.jpg", 1, 0);
     130                                if(file_exist(savefile) && !file_exist(savethumb))
     131                                {
     132                                        buf = loadjpg(savefile, &width, &height, &rowbytes, &channels, 16);
     133                                        buf = savejpg(savethumb, width, height, channels, 91, 140, 70, buf);
     134                                }
     135                                free(savethumb); savethumb = NULL;
    122136                                free(buf); buf = NULL;
    123                                 free(savethumb); savethumb = NULL;
    124137                        }
    125138                        else if(flag == 0)
  • titan/plugins/tmc/tmc.h

    r16835 r16853  
    119119                {
    120120                        if(menuid == 2) //picture
    121                                 tmpstr = ostrcat(node->node->poster, NULL, 0, 0);
     121                        {
     122                                if(node->node->poster != NULL)
     123                                {
     124                                        tmpstr = ostrcat(getconfig("mediadbpath", NULL), "/", 0, 0);
     125                                        tmpstr = ostrcat(tmpstr, node->node->poster, 1, 0);
     126          if(getconfigint("tmcpreview", NULL) == 0)
     127            tmpstr = ostrcat(tmpstr, "_thumb.jpg", 1, 0);
     128          else
     129            tmpstr = ostrcat(tmpstr, "_xxxx.jpg", 1, 0);
     130                                }
     131                                else
     132                                {
     133          if(getconfigint("tmcpreview", NULL) == 2)
     134            tmpstr = ostrcat(node->node->path, "/", 0, 0);
     135          else
     136            tmpstr = ostrcat(node->node->path, "/.Thumbnails/", 0, 0);
     137                                        tmpstr = ostrcat(tmpstr, node->node->file, 1, 0);
     138                                        tmpstr = addmountpart(tmpstr, 1);
     139                                }
     140                        }
    122141                        else if(menuid == 3) //video
    123142                        {
    124143                                tmpstr = ostrcat(getconfig("mediadbpath", NULL), "/", 0, 0);
    125144                                tmpstr = ostrcat(tmpstr, node->node->poster, 1, 0);
    126                                 tmpstr = ostrcat(tmpstr, "_thumb.jpg", 1, 0);
     145                                if(getconfigint("tmcpreview", NULL) == 0)
     146          tmpstr = ostrcat(tmpstr, "_thumb.jpg", 1, 0);
     147        else
     148          tmpstr = ostrcat(tmpstr, "_xxxx.jpg", 1, 0);
    127149                        }
    128150                       
     
    319341                formats = ostrcat(formats, "*.flac *.ogg *.mp3 *.avi *.dat *.divx *.flv *.mkv *.m4v *.mp4 *.mov *.mpg *.mpeg *.mts *.m2ts *.trp *.ts *.vdr *.vob *.wmv *.rm", 1, 0);
    320342        //else
    321         //      formats = ostrcat(formats, "*.ts *.mts *.m2ts", 1, 0);
     343                //formats = ostrcat(formats, "*.ts *.mts *.m2ts", 1, 0);
    322344
    323345        ret = screendir(getconfig("rec_moviepath", NULL), formats, NULL, NULL, NULL, NULL, 0, "SELECT", getrcconfigint("rcgreen", NULL), NULL, 0, NULL, 0, dir->width, dir->prozwidth, dir->height, dir->prozheight, 0);
     
    476498        struct skin* scan = getscreennode(tmcpic3, "scan");
    477499        struct skin* bgpic = getscreennode(tmcpic3, "bgpic");
     500  struct skin* preview = getscreennode(tmcpic3, "preview");
    478501        struct skin* tmp = NULL;
    479502        char* tmppic = NULL;
     
    488511        scan->hidden = NO;
    489512        bgpic->hidden = NO;
     513  preview->hidden = NO;
    490514
    491515        addchoicebox(pictimeout, "5", "5");
     
    519543        addchoicebox(bgpic, "1000", _("no pic"));
    520544        setchoiceboxselection(bgpic, getconfig("tmcbgpic", NULL));
     545 
     546  addchoicebox(preview, "0", _("slow"));
     547        addchoicebox(preview, "1", _("normal"));
     548  addchoicebox(preview, "2", _("high"));
     549        setchoiceboxselection(preview, getconfig("tmcpreview", NULL));
    521550
    522551        addscreenrc(tmcpic3, listbox);
     
    540569                        if(ostrcmp(bgpic->ret, getconfig("tmcbgpic", NULL)) != 0) ret = 1;
    541570                        addconfigscreencheck("tmcbgpic", bgpic, "0");
     571      addconfigscreencheck("tmcpreview", preview, "0");
    542572                        break;
    543573                }
     
    549579        scan->hidden = YES;
    550580        bgpic->hidden = YES;
     581  preview->hidden = YES;
    551582
    552583        delownerrc(tmcpic3);
     
    743774                                if(ostrcmp(locked->ret, "0") == 0 || ostrcmp(locked->ret, "3") == 0)
    744775                                        node->flag = setbit(node->flag, 31);
    745                                 node = createmediadb(node, tmpstr, type, title->ret, year->ret, released->ret, runtime->ret, genre->ret, director->ret, writer->ret, actors->ret, plot->ret, node->id, rating->ret, votes->ret, node->path, node->file, node->flag);
    746776
    747777                                if(picret != NULL)
     
    753783                                       
    754784                                        buf = loadjpg(picret, &width, &height, &rowbytes, &channels, 16);
    755 
    756                                         //TODO: save pic in other sizes
    757785                                        thumb = ostrcat(getconfig("mediadbpath", NULL), "/", 0, 0);
    758786                                        thumb = ostrcat(thumb, tmpstr, 1, 0);
    759787                                        thumb = ostrcat(thumb, "_thumb.jpg", 1, 0);
    760788                                        buf = savejpg(thumb, width, height, channels, 91, 140, 70, buf);
    761 
     789                                        free(thumb); thumb = NULL;
    762790                                        free(buf); buf = NULL;
     791         
     792                                        buf = loadjpg(picret, &width, &height, &rowbytes, &channels, 16);
     793                                        thumb = ostrcat(getconfig("mediadbpath", NULL), "/", 0, 0);
     794                                        thumb = ostrcat(thumb, tmpstr, 1, 0);
     795                                        thumb = ostrcat(thumb, "_xxxx.jpg", 1, 0);
     796                                        buf = savejpg(thumb, width, height, channels, 91, 140, 70, buf);
    763797                                        free(thumb); thumb = NULL;
    764                                 }
     798                                        free(buf); buf = NULL;
     799                                       
     800                                        node = createmediadb(node, tmpstr, type, title->ret, year->ret, released->ret, runtime->ret, genre->ret, director->ret, writer->ret, actors->ret, plot->ret, tmpstr, rating->ret, votes->ret, node->path, node->file, node->flag);
     801                                }
     802                                else
     803                                        node = createmediadb(node, tmpstr, type, title->ret, year->ret, released->ret, runtime->ret, genre->ret, director->ret, writer->ret, actors->ret, plot->ret, node->poster, rating->ret, votes->ret, node->path, node->file, node->flag);
    765804
    766805                                free(tmpstr); tmpstr = NULL;
  • titan/skins/tmc/skin.xml

    r16798 r16853  
    4949<node hidden=yes name=scan type=choicebox parent=listbox valign=middle posx=0 text="Scan" bordercol=bordercol width=100%>
    5050<node hidden=yes name=bgpic type=choicebox parent=listbox valign=middle posx=0 text="Back Pic" bordercol=bordercol width=100%>
     51<node hidden=yes name=preview type=choicebox parent=listbox valign=middle posx=0 text="Preview" bordercol=bordercol width=100%>
    5152<node hidden=yes name=imdbsearch parent=listbox valign=middle posx=0 text="IMDB Search" bordercol=bordercol width=100%>
    5253<node hidden=yes name=info parent=listbox valign=middle posx=0 text="Info" bordercol=bordercol width=100%>
  • titan/titan/mediadb.h

    r16841 r16853  
    11#ifndef MEDIADB_H
    22#define MEDIADB_H
     3
     4void debugimdbnode(struct imdb* node)
     5{
     6  if(node != NULL)
     7  {
     8        debug(133, "----------------------mediadb start----------------------");
     9        debug(133, "use id: %s", node->id);
     10        debug(133, "use title: %s", node->title);
     11        debug(133, "use genre: %s", node->genre);
     12        debug(133, "use writer: %s", node->writer);
     13        debug(133, "use director: %s", node->director);
     14        debug(133, "use released: %s", node->released);
     15        debug(133, "use actors: %s", node->actors);
     16        debug(133, "use plot: %s", node->plot);
     17        debug(133, "use poster: %s", node->poster);
     18        debug(133, "use rating: %s", node->rating);
     19        debug(133, "use votes: %s", node->votes);
     20        debug(133, "use runtime: %s", node->runtime);
     21        debug(133, "use year: %s", node->year);
     22        debug(133, "use rated: %s", node->rated);
     23        debug(133, "----------------------mediadb end----------------------");
     24  }
     25}
    326
    427//flag 0: with lock
     
    14541477                        strstrip(shortname);
    14551478
    1456                         //TODO: got imdb infos
    1457 
     1479                        //got imdb infos
    14581480                        struct skin* imdbplugin = getplugin("IMDb");
    14591481                        if(imdbplugin != NULL)
     
    14941516                        }
    14951517
    1496 printf("wo1\n");
    1497 if(imdb != NULL)
    1498 {
    1499         debug(133, "----------------------mediadb start----------------------");
    1500         debug(133, "use id: %s", imdb->id);
    1501         debug(133, "use title: %s", imdb->title);
    1502         debug(133, "use genre: %s", imdb->genre);
    1503         debug(133, "use writer: %s", imdb->writer);
    1504         debug(133, "use director: %s", imdb->director);
    1505         debug(133, "use released: %s", imdb->released);
    1506         debug(133, "use actors: %s", imdb->actors);
    1507         debug(133, "use plot: %s", imdb->plot);
    1508         debug(133, "use poster: %s", imdb->poster);
    1509         debug(133, "use rating: %s", imdb->rating);
    1510         debug(133, "use votes: %s", imdb->votes);
    1511         debug(133, "use runtime: %s", imdb->runtime);
    1512         debug(133, "use year: %s", imdb->year);
    1513         debug(133, "use rated: %s", imdb->rated);
    1514         debug(133, "----------------------mediadb end----------------------");
    1515 }
     1518      debugimdbnode(imdb);
    15161519                       
    15171520                        if(imdb != NULL && tmdb != NULL)
    15181521                        {
    1519 printf("wo1.1\n");
    15201522                                if(imdb->id == NULL) imdb->id = ostrcat(imdb->id, tmdb->imdbid, 1, 0);                 
    15211523                                if(imdb->title == NULL) imdb->title = ostrcat(imdb->title, tmdb->title, 1, 0); 
     
    15331535                                if(imdb->year == NULL) imdb->year = ostrcat(imdb->year, tmdb->year, 1, 0);                             
    15341536                        }
    1535 printf("wo1.2\n");
    1536 
    1537 if(imdb != NULL)
    1538 {
    1539         debug(133, "----------------------mediadb start----------------------");
    1540         debug(133, "use id: %s", imdb->id);
    1541         debug(133, "use title: %s", imdb->title);
    1542         debug(133, "use genre: %s", imdb->genre);
    1543         debug(133, "use writer: %s", imdb->writer);
    1544         debug(133, "use director: %s", imdb->director);
    1545         debug(133, "use released: %s", imdb->released);
    1546         debug(133, "use actors: %s", imdb->actors);
    1547         debug(133, "use plot: %s", imdb->plot);
    1548         debug(133, "use poster: %s", imdb->poster);
    1549         debug(133, "use rating: %s", imdb->rating);
    1550         debug(133, "use votes: %s", imdb->votes);
    1551         debug(133, "use runtime: %s", imdb->runtime);
    1552         debug(133, "use year: %s", imdb->year);
    1553         debug(133, "use rated: %s", imdb->rated);
    1554         debug(133, "----------------------mediadb end----------------------");
    1555 }
     1537
     1538      debugimdbnode(imdb);
     1539     
    15561540                        if(imdb != NULL && imdbapi != NULL)
    15571541                        {
    1558 printf("wo1.3\n");
    15591542                                if(imdb->id == NULL) imdb->id = ostrcat(imdb->id, imdbapi->id, 1, 0);                   
    15601543                                if(imdb->title == NULL) imdb->title = ostrcat(imdb->title, imdbapi->title, 1, 0);       
     
    15731556                        }
    15741557
    1575 printf("wo2\n");
    15761558                        debug(777, "shortname: %s", shortname);
    15771559                        free(shortname); shortname = NULL;
    1578                         if(imdb != NULL)
    1579                         {
    1580                                 debug(133, "----------------------mediadb start----------------------");
    1581                                 debug(133, "use id: %s", imdb->id);
    1582                                 debug(133, "use title: %s", imdb->title);
    1583                                 debug(133, "use genre: %s", imdb->genre);
    1584                                 debug(133, "use writer: %s", imdb->writer);
    1585                                 debug(133, "use director: %s", imdb->director);
    1586                                 debug(133, "use released: %s", imdb->released);
    1587                                 debug(133, "use actors: %s", imdb->actors);
    1588                                 debug(133, "use plot: %s", imdb->plot);
    1589                                 debug(133, "use poster: %s", imdb->poster);
    1590                                 debug(133, "use rating: %s", imdb->rating);
    1591                                 debug(133, "use votes: %s", imdb->votes);
    1592                                 debug(133, "use runtime: %s", imdb->runtime);
    1593                                 debug(133, "use year: %s", imdb->year);
    1594                                 debug(133, "use rated: %s", imdb->rated);
    1595                                 debug(133, "----------------------mediadb end----------------------");
    1596                         }
    1597                         else
    1598                                 debug(133, "----------------------mediadb skipped----------------------");
     1560                       
     1561      debugimdbnode(imdb);
    15991562                       
    16001563                        debug(777, "add video: %s/%s", shortpath, file);
    16011564                        if(imdb != NULL)
    16021565                        {
    1603 printf("wo2.1\n");
    16041566                                debug(777, "imdb id %s", imdb->id);
    1605 printf("wo2.2\n");
    1606 
    16071567                                createmediadb(node, imdb->id, type, imdb->title, imdb->year, imdb->released, imdb->runtime, imdb->genre, imdb->director, imdb->writer, imdb->actors, imdb->plot, imdb->id, imdb->rating, imdb->votes, shortpath, file, 0);
    1608 printf("wo2.3\n");
    1609 
    16101568                        }
    16111569                        else
    1612                         {
    1613 printf("wo2.0\n");
    16141570                                createmediadb(node, NULL, type, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, shortpath, file, 0);
    1615                         }
    1616 printf("wo3\n");
    16171571
    16181572                        if(imdbplugin != NULL)
     
    16241578                        }
    16251579                        imdb = NULL;
    1626 printf("wo4\n");                       
     1580                       
    16271581                        if(imdbapiplugin != NULL)
    16281582                        {
     
    16331587                        }
    16341588                        imdbapi = NULL;
    1635 printf("wo5\n");
    16361589
    16371590                        if(tmdbplugin != NULL)
     
    16431596                        }
    16441597                        tmdb = NULL;
    1645 printf("wo6\n");
    16461598                }
    16471599                else if(type == 1)
     
    16601612                                thumbfile = checkthumb(path, file);
    16611613                                if(thumbfile == NULL)
    1662                                 {
    1663                                         thumbfile = ostrcat(path, "/.Thumbnails/", 0, 0);
    1664                                         thumbfile = ostrcat(thumbfile, file, 1, 0);
    16651614                                        addqueue(101, (void*)path, strlen(path) + 1, (void*)file, strlen(file) + 1, 0, NULL);
    1666                                 }
    1667                         }
    1668 
    1669                         createmediadb(node, NULL, type, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, thumbfile, NULL, NULL, shortpath, file, 0);
    1670                         free(thumbfile); thumbfile = NULL;
     1615                        }
     1616      free(thumbfile); thumbfile = NULL;
     1617
     1618                        createmediadb(node, NULL, type, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, shortpath, file, 0);
    16711619                }
    16721620        }
Note: See TracChangeset for help on using the changeset viewer.