hi
following problem: i need the absolute path for the thumbnail of the currently played video.
i am using xbmc.getCacheThumbName() but this only returns a filename which cannot be used directly, eg: 8765432.tbn'.
the 'real' file would be (on linux): /home/someuser/.xbmc/userdata/Thumbnails/Video/8/auto-8765432.tbn
i couln't find a 'clean' / 'beautiful' way for this and i am now using this code:
thumbnail_rel = xbmc.getCacheThumbName( xbmc.getInfoLabel("Player.Filenameandpath") )
thumbnail_abs = xbmc.translatePath( "special://profile/Thumbnails/Video/" ) + thumbnail_rel[0] + "/auto-" + thumbnail_rel
it works. but is there a better way for this?
wastl
Junior Member Posts: 14 Joined: Apr 2012 Reputation: 0 |
2012-05-29 13:54
Post: #1
|
| find quote |
blittan
Team-XBMC Handyman Joined: Jun 2004 Reputation: 11 Location: Sweden |
2012-05-29 14:17
Post: #2
use os.path.basename would be cleaner / better
Always read the XBMC online-manual, FAQ and search the forum before posting. Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules. If you don't have the time to read them, please don't take the time to post in this forum! For troubleshooting and bug reporting please make sure you read this first. |
| find quote |
wastl
Junior Member Posts: 14 Joined: Apr 2012 Reputation: 0 |
2012-05-29 14:35
Post: #3
what does os.path.basename improve / do better here?
what i want to improve is: avoiding concatination of path to the video cache + first char. of xbmc.getCacheThumbName() + "auto-" + xbmc.getCacheThumbName(). |
| find quote |
vdrfan
Team-XBMC Developer Posts: 2,793 Joined: Jan 2008 Reputation: 7 Location: Germany |
2012-05-29 14:44
Post: #4
You could still try to get it directly from the player.
Example: icon = "file://%s" % xbmc.translatePath(xbmc.getInfoImage("VideoPlayer.Cover")) Always read the XBMC online-manual, FAQ and search the forum before posting. Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules For troubleshooting and bug reporting please make sure you read this first. |
| find quote |
wastl
Junior Member Posts: 14 Joined: Apr 2012 Reputation: 0 |
2012-05-29 17:00
Post: #5
yep, getInfoImage() does the trick. thanks!
i've tried xbmc.getInfoLabel("VideoPlayer.Cover") before but this one returned an empty string ... but xbmc.getInfoImage() returns exactly what i want. |
| find quote |
vdrfan
Team-XBMC Developer Posts: 2,793 Joined: Jan 2008 Reputation: 7 Location: Germany |
2012-05-29 17:02
Post: #6
Glad to hear
Always read the XBMC online-manual, FAQ and search the forum before posting. Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules For troubleshooting and bug reporting please make sure you read this first. |
| find quote |
wastl
Junior Member Posts: 14 Joined: Apr 2012 Reputation: 0 |
2012-06-20 00:55
Post: #7
here i'm again with another thumbnail problem:
this time i'd need the cached thumbnail of a youtube item: xbmc.getInfoLabel("VideoPlayer.Cover") returns the 'youtube'-URL of the thumbnail, eg: http://i.ytimg.com/vi/blahblabla/0.jpg, but the image has already been cached by youtube-plugin (i can find it in the userdata-directory) so it would be fine to use the thumbnail that has already been cached and not to re-fetch it. |
| find quote |
jmarshall
Team-XBMC Developer Posts: 24,564 Joined: Oct 2003 Reputation: 138 |
2012-06-20 01:02
Post: #8
You won't be refetching it, just set the thumbnail to that URL and XBMC will take care of the rest.
Always read the XBMC online-manual, FAQ and search the forum before posting. Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules. For troubleshooting and bug reporting please make sure you read this first. ![]() |
| find quote |
wastl
Junior Member Posts: 14 Joined: Apr 2012 Reputation: 0 |
2012-06-20 07:21
Post: #9
the python service processes the information for a daemon that is not a part of XBMC (thus i'd need the absolute file name of the cached image).
|
| find quote |
wastl
Junior Member Posts: 14 Joined: Apr 2012 Reputation: 0 |
2012-06-20 16:10
Post: #10
i've found a rather ugly, but working 'workaround':
Code: currentitem['Thumbnail'] = xbmc.translatePath(xbmc.getInfoImage("VideoPlayer.Cover"))but maybe there's a more beautiful way for this ... (get_crc32() is the method that i've found somewhere in the xbmc-wiki) |
| find quote |

![[Image: badge.gif]](http://www.ohloh.net/projects/9132/badge.gif)
Search
Help