Changeset 16853
- Timestamp:
- 06/26/12 21:01:50 (12 years ago)
- Location:
- titan
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
titan/plugins/imdbapi/imdbapi.h
r16812 r16853 111 111 free((*first)->poster); 112 112 (*first)->poster = savefile; 113 113 114 //create thumb 114 115 savethumb = ostrcat(getconfig("mediadbpath", NULL), "/", 0, 0); … … 120 121 buf = savejpg(savethumb, width, height, channels, 91, 140, 70, buf); 121 122 } 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; 122 136 free(buf); buf = NULL; 123 free(savethumb); savethumb = NULL;124 137 } 125 138 else if(flag == 0) -
titan/plugins/tmc/tmc.h
r16835 r16853 119 119 { 120 120 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 } 122 141 else if(menuid == 3) //video 123 142 { 124 143 tmpstr = ostrcat(getconfig("mediadbpath", NULL), "/", 0, 0); 125 144 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); 127 149 } 128 150 … … 319 341 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); 320 342 //else 321 //formats = ostrcat(formats, "*.ts *.mts *.m2ts", 1, 0);343 //formats = ostrcat(formats, "*.ts *.mts *.m2ts", 1, 0); 322 344 323 345 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); … … 476 498 struct skin* scan = getscreennode(tmcpic3, "scan"); 477 499 struct skin* bgpic = getscreennode(tmcpic3, "bgpic"); 500 struct skin* preview = getscreennode(tmcpic3, "preview"); 478 501 struct skin* tmp = NULL; 479 502 char* tmppic = NULL; … … 488 511 scan->hidden = NO; 489 512 bgpic->hidden = NO; 513 preview->hidden = NO; 490 514 491 515 addchoicebox(pictimeout, "5", "5"); … … 519 543 addchoicebox(bgpic, "1000", _("no pic")); 520 544 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)); 521 550 522 551 addscreenrc(tmcpic3, listbox); … … 540 569 if(ostrcmp(bgpic->ret, getconfig("tmcbgpic", NULL)) != 0) ret = 1; 541 570 addconfigscreencheck("tmcbgpic", bgpic, "0"); 571 addconfigscreencheck("tmcpreview", preview, "0"); 542 572 break; 543 573 } … … 549 579 scan->hidden = YES; 550 580 bgpic->hidden = YES; 581 preview->hidden = YES; 551 582 552 583 delownerrc(tmcpic3); … … 743 774 if(ostrcmp(locked->ret, "0") == 0 || ostrcmp(locked->ret, "3") == 0) 744 775 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);746 776 747 777 if(picret != NULL) … … 753 783 754 784 buf = loadjpg(picret, &width, &height, &rowbytes, &channels, 16); 755 756 //TODO: save pic in other sizes757 785 thumb = ostrcat(getconfig("mediadbpath", NULL), "/", 0, 0); 758 786 thumb = ostrcat(thumb, tmpstr, 1, 0); 759 787 thumb = ostrcat(thumb, "_thumb.jpg", 1, 0); 760 788 buf = savejpg(thumb, width, height, channels, 91, 140, 70, buf); 761 789 free(thumb); thumb = NULL; 762 790 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); 763 797 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); 765 804 766 805 free(tmpstr); tmpstr = NULL; -
titan/skins/tmc/skin.xml
r16798 r16853 49 49 <node hidden=yes name=scan type=choicebox parent=listbox valign=middle posx=0 text="Scan" bordercol=bordercol width=100%> 50 50 <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%> 51 52 <node hidden=yes name=imdbsearch parent=listbox valign=middle posx=0 text="IMDB Search" bordercol=bordercol width=100%> 52 53 <node hidden=yes name=info parent=listbox valign=middle posx=0 text="Info" bordercol=bordercol width=100%> -
titan/titan/mediadb.h
r16841 r16853 1 1 #ifndef MEDIADB_H 2 2 #define MEDIADB_H 3 4 void 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 } 3 26 4 27 //flag 0: with lock … … 1454 1477 strstrip(shortname); 1455 1478 1456 //TODO: got imdb infos 1457 1479 //got imdb infos 1458 1480 struct skin* imdbplugin = getplugin("IMDb"); 1459 1481 if(imdbplugin != NULL) … … 1494 1516 } 1495 1517 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); 1516 1519 1517 1520 if(imdb != NULL && tmdb != NULL) 1518 1521 { 1519 printf("wo1.1\n");1520 1522 if(imdb->id == NULL) imdb->id = ostrcat(imdb->id, tmdb->imdbid, 1, 0); 1521 1523 if(imdb->title == NULL) imdb->title = ostrcat(imdb->title, tmdb->title, 1, 0); … … 1533 1535 if(imdb->year == NULL) imdb->year = ostrcat(imdb->year, tmdb->year, 1, 0); 1534 1536 } 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 1556 1540 if(imdb != NULL && imdbapi != NULL) 1557 1541 { 1558 printf("wo1.3\n");1559 1542 if(imdb->id == NULL) imdb->id = ostrcat(imdb->id, imdbapi->id, 1, 0); 1560 1543 if(imdb->title == NULL) imdb->title = ostrcat(imdb->title, imdbapi->title, 1, 0); … … 1573 1556 } 1574 1557 1575 printf("wo2\n");1576 1558 debug(777, "shortname: %s", shortname); 1577 1559 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); 1599 1562 1600 1563 debug(777, "add video: %s/%s", shortpath, file); 1601 1564 if(imdb != NULL) 1602 1565 { 1603 printf("wo2.1\n");1604 1566 debug(777, "imdb id %s", imdb->id); 1605 printf("wo2.2\n");1606 1607 1567 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 1610 1568 } 1611 1569 else 1612 {1613 printf("wo2.0\n");1614 1570 createmediadb(node, NULL, type, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, shortpath, file, 0); 1615 }1616 printf("wo3\n");1617 1571 1618 1572 if(imdbplugin != NULL) … … 1624 1578 } 1625 1579 imdb = NULL; 1626 printf("wo4\n");1580 1627 1581 if(imdbapiplugin != NULL) 1628 1582 { … … 1633 1587 } 1634 1588 imdbapi = NULL; 1635 printf("wo5\n");1636 1589 1637 1590 if(tmdbplugin != NULL) … … 1643 1596 } 1644 1597 tmdb = NULL; 1645 printf("wo6\n");1646 1598 } 1647 1599 else if(type == 1) … … 1660 1612 thumbfile = checkthumb(path, file); 1661 1613 if(thumbfile == NULL) 1662 {1663 thumbfile = ostrcat(path, "/.Thumbnails/", 0, 0);1664 thumbfile = ostrcat(thumbfile, file, 1, 0);1665 1614 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); 1671 1619 } 1672 1620 }
Note: See TracChangeset
for help on using the changeset viewer.