![]() |
|
Register | Forum Rules | FAQs | Members List | Social Groups | Downloads | Search | Today's Posts | Mark Forums Read |
SageTV Github Development Discussion related to SageTV Open Source Development. Use this forum for development topics about the Open Source versions of SageTV, hosted on Github. |
![]() |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
||||
|
||||
How to Get Channel Logo FileName
I am wanting to get the filename for each channel logo. The api call GetChannelLogo can give me the logo but I need the filename of the png image. From searching the forums I see that they are stored in the GeneratedThumbnails directory. But I am unclear how to map a name such as:
url-https3a2f2fs32eamazonaws2ecom2fschedulesdirect2fassets2fstationLogos2fs586465fh35faa2epng which is the png image file on my system for cnn. I found from using GetAllChannels I get back for the cnn example above this: <Channel> <ChannelDescription> <![CDATA[ Cable News Network ]]> </ChannelDescription> <ChannelNetwork/> <IsChannelViewable>false</IsChannelViewable> <ChannelLogoURL> <![CDATA[ "https://s3.amazonaws.com/schedulesdirect/assets/stationLogos/s10142_h3_aa.png" ]]> </ChannelLogoURL> <ChannelLogoCount>1</ChannelLogoCount> <IsChannelObject>true</IsChannelObject> <StationID>10142</StationID> <ChannelNumber> <![CDATA[ 202 ]]> </ChannelNumber> <ChannelName> <![CDATA[ CNN ]]> </ChannelName> </Channel> The url above does show the image but I need the filename of the image already in the GeneratedThumbnails directory. I don't see any part of the url that would match up with the filename. I also looked here: "https://github.com/google/sagetv/wiki/Schedules-Direct-EPG-(BETA)" but couldn't find the mapping info I need. Does anyone know how to map the filenames in the GeneratedThumbnails to a channel name or number? Last edited by davidb; 04-25-2018 at 12:05 PM. |
#2
|
||||
|
||||
Try the GetChannelLogoURL API call...that won't give you the GeneratedThumbnails path...but it will give you the URL to where you can download it from.
__________________
Jeffrey Kardatzke Founder of SageTV |
#3
|
||||
|
||||
I see that GetChannelLogoURL does return the url. I can go this route if I need to but using GetChannelLogoURL means I have to duplicate the channel logos that are already saved in the GeneratedThumbnails directory and will have to do a network request every 24 hours on every channel someone gets. This will have to happen for everyone that uses my IOS client. All for data that is already in the GeneratedThumbnails directory!
To illustrate what I mean the folllowing is using GetChannelLogo for CNN Small Channel CNNHD 202 "https://s3.amazonaws.com/schedulesdirect/assets/stationLogos/s58646_h3_aa.png" Med Channel CNNHD 202 "https://s3.amazonaws.com/schedulesdirect/assets/stationLogos/s58646_h3_aa.png" Large Channel CNNHD 202 "https://s3.amazonaws.com/schedulesdirect/assets/stationLogos/s58646_h3_aa.png" but buy copying the generatedThumbnails to another directory and doing a wildcard rename then loolking in explorer I see that on my system in the GeneratedThumbnails directory the cnn logo is: url-https3a2f2fs32eamazonaws2ecom2fschedulesdirect2fassets2fstationLogos2fs586465fh35faa2epng None of the portions of the filenames match up. If I can't find a way this could work but somewhere there has to be a mapping between the this png image in the GeneratedThumbnails directory and when sage UI needs to display the thumbnail for cnn. Sage knows how but I don't! LOL Last edited by davidb; 04-27-2018 at 05:39 AM. |
#4
|
|||
|
|||
Sage uses this to convert the URL to a local cache name. Is that what you're looking for? It was in MetaImage.java
Code:
myCacheFile = new File(MediaFile.THUMB_FOLDER, "url-" + convertToAsciiName(src.toString())); . . . public static String convertToAsciiName(String s) { StringBuffer sb = new StringBuffer(); for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (Character.isLetterOrDigit(c)) sb.append(c); else sb.append(Integer.toString(c, 16)); } return sb.toString(); } Last edited by wnjj; 04-26-2018 at 04:07 PM. |
#5
|
||||
|
||||
Yes that is what I needed I just didn't know I needed it! I can now get the Channel Logos.
Thanks! Quote:
|
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Filename scraper in bmt | VCRUser | Batch Metadata Tools | 0 | 05-31-2017 07:19 PM |
Channel in filename | element33 | SageTV Software | 3 | 04-13-2011 08:11 AM |
How do I get rid of the filename under cover art! | datoney | SageTV v7 Customizations | 17 | 02-18-2011 05:23 AM |
Filename problem | davidw4021 | SageTV Software | 1 | 03-06-2009 02:35 PM |
#'s in filename mean? | xlr8shun | SageTV Software | 1 | 07-28-2004 11:44 AM |