SageTV Community  

Go Back   SageTV Community > SageTV Products > SageTV EPG Service
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV EPG Service Discussion related to the SageTV EPG Service used within SageTV. Questions about service area coverage, channel lineups, EPG listings, XMLTV, or anything else related to the service or programming guide data for SageTV should be posted here.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-04-2022, 01:38 PM
nyplayer nyplayer is offline
SageTVaholic
 
Join Date: Sep 2005
Posts: 4,997
XMLTV.properties Season Episode ?

I am trying to get TVE from Channels into sagetv but I have 1 problem the Season and Episode is not parsing correctly coming out under misc ...


Is there anything I can add to the xmltv.properties to get the Season and Episode correctly ?


Code:
configurations=xmltv.properties
provider.name=TVESOURCE
provider.id=1
xmltv.files=C:\\\SageTVE\\TVEXFINITY.xml

run.before=C:\\\SageTVE\\getSageTVE.bat
max.stars=4

max.subcategories=10
translate.category.film=Movie
translate.category.Sport=Sports event
translate.category.News=News

rating.*.NR=NR

title.add.year=false
episode.name.add.episode.number=false
episode.name.add.part.number=true
report.missing.translate.category=true
rerun.after.date=8
rerun.after.date.categories=*
categories.for.star-rating=Movie
rerun.no-date.categories=Series
Code:
#Generator: CMT Metadata, written on Tuesday, January 4, 2022 11:19 AM
Subtitled=false
Genre=Series/Episode / Crime drama / Fantasy
Contestant=
ChannelPremiere=false
RunningTime=0
Widescreen=false
Guest=
Choreographer=
ExtendedRatings=
Dolby=false
Composer=
Writer=
Stereo=false
ParentalRating=
EpisodeNumber=0
PropertiesWrittenBy=CMT
Description=Goliath damages KITT, leaving Michael to rebuild him.
ExternalID=EP3HOH8y0102
SAP=false
HDTV=false
Title=Knight Rider
SeasonNumber=0
AltEpisodeNumber=
CC=false
SeriesFinale=false
Live=false
Voice=
Surround=false
Judge=
EpisodeName=Goliath
Director=
SeriesPremiere=false
Anchor=
Guest\ Voice=
3D=false
DD5.1=false
Executive\ Producer=
Guest\ Star=
SeasonPremiere=false
AiringTime=
Musical\ Guest=
New=false
Letterbox=false
Taped=false
Producer=
Misc=Season 2;Episode 2
Language=
Dubbed=false
Narrator=
SeasonFinale=false
Rated=
Correspondent=
OriginalAirDate=0
Host=
Team=
Year=1983
Premiere=false
AiringDuration=
Actor=David Hasselhoff;Edward Mulhare;Rebecca Holden
__________________
Channels DVR UBUNTU Server 2 Primes 3 Connects TVE SageTV Docker with input from Channels DVR XMLTV and M3U VIA Opendct.

Last edited by nyplayer; 01-04-2022 at 01:42 PM.
Reply With Quote
  #2  
Old 01-04-2022, 01:49 PM
jusjoken jusjoken is offline
SageTVaholic
 
Join Date: Dec 2005
Location: Strathmore, AB
Posts: 2,727
I wonder why the CMT properties file has 0 for both episode and season

K
__________________
If you wish to see what I am up to and support my efforts visit my Patreon page
Reply With Quote
  #3  
Old 01-04-2022, 03:22 PM
nyplayer nyplayer is offline
SageTVaholic
 
Join Date: Sep 2005
Posts: 4,997
Quote:
Originally Posted by jusjoken View Post
I wonder why the CMT properties file has 0 for both episode and season

K
here is the XML ...

Code:
  <programme start="20220104180000 +0000" stop="20220104190000 +0000" channel="6752">
    <title>Knight Rider</title>
    <sub-title>Goliath</sub-title>
    <desc>Goliath damages KITT, leaving Michael to rebuild him.</desc>
    <category>Episode</category>
    <category>Series</category>
    <category>Crime drama</category>
    <category>Fantasy</category>
    <icon src="https://tmsimg.fancybits.co/assets/p7893922_b_h9_aa.jpg?w=720&amp;h=540"></icon>
    <series-id system="tms">183977</series-id>
    <date>19831002</date>
    <previously-shown></previously-shown>
    <episode-num system="tms">EP000024850073</episode-num>
    <episode-num system="onscreen">S2E2</episode-num>
    <episode-num system="xmltv_ns">1.1.</episode-num>
    <credits>
      <actor>David Hasselhoff</actor>
      <actor>Edward Mulhare</actor>
      <actor>Rebecca Holden</actor>
    </credits>
  </programme>
__________________
Channels DVR UBUNTU Server 2 Primes 3 Connects TVE SageTV Docker with input from Channels DVR XMLTV and M3U VIA Opendct.
Reply With Quote
  #4  
Old 01-04-2022, 03:53 PM
nyplayer nyplayer is offline
SageTVaholic
 
Join Date: Sep 2005
Posts: 4,997
I see where it is getting the misc from ... this is the xml generated from a recent recording notice misc ...


Code:
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE sageShowInfo PUBLIC "-//NIELM//DTD SAGESHOWINFO XML 1.3//EN" "http://sageplugins.sourceforge.net/nielm_modules/sagexmlinfo/sageshowinfo_1_3.dtd">
<sageShowInfo version="1.3">
    <systemInfo>
        <alertLevel description="Error" level="3"/>
    </systemInfo>
    <channelList>
        <channel channelId="49094">
            <channelName>CHARGE</channelName>
            <channelDescription>WCWNDT2</channelDescription>
            <channelNumber>13</channelNumber>
        </channel>
    </channelList>
    <favoriteList/>
    <showList>
        <show epgId="EP3MCtKJ0005">
            <title>CHiPs</title>
            <episode>Career Day</episode>
            <category>Series</category>
            <subCategory>Episode / Crime drama / Action</subCategory>
            <description>Ponch tickets his high-school principal (Richard Deacon), who invites him to speak on career day.</description>
            <peopleList>
                <person role="Actor">Larry Wilcox</person>
                <person role="Actor">Erik Estrada</person>
                <person role="Actor">Robert Pine</person>
                <person role="Director">Ric Rondell</person>
            </peopleList>
            <year>1977</year>
            <misc>Season 1, Episode 5</misc>
            <airing channelId="49094" duration="3600" sageDbId="2220869" startTime="2022-01-04T21:00:00.00Z">
                <manualRecord/>
                <recordSchedule duration="3600" startTime="2022-01-04T21:00:00.00Z"/>
                <mediafile duration="153" sageDbId="2253289" startTime="2022-01-04T21:46:49.06Z" type="TV">
                    <segmentList>
                        <segment duration="153" filePath="C:\Users\epere\Videos\SageTV\CHiPs - Career Day - 2220869-0.ts" startTime="2022-01-04T21:46:49.06Z"/>
                    </segmentList>
                </mediafile>
            </airing>
        </show>
    </showList>
    <systemMessageList/>
</sageShowInfo>
__________________
Channels DVR UBUNTU Server 2 Primes 3 Connects TVE SageTV Docker with input from Channels DVR XMLTV and M3U VIA Opendct.
Reply With Quote
  #5  
Old 01-04-2022, 06:27 PM
jusjoken jusjoken is offline
SageTVaholic
 
Join Date: Dec 2005
Location: Strathmore, AB
Posts: 2,727
Is this resolved then?

Sorry... This is an unknown area for me so I may be able to dig in a bit and help but would need some details on the process you are using.

K
__________________
If you wish to see what I am up to and support my efforts visit my Patreon page
Reply With Quote
  #6  
Old 01-04-2022, 06:36 PM
nyplayer nyplayer is offline
SageTVaholic
 
Join Date: Sep 2005
Posts: 4,997
Quote:
Originally Posted by jusjoken View Post
Is this resolved then?

Sorry... This is an unknown area for me so I may be able to dig in a bit and help but would need some details on the process you are using.

K
No but it might be that Sage is looking for the season and episode on different tags then the XML I am using as input to XMLTV. I might have to run the xml through a script and change the season and episode that SageTV expects ... but I am not sure what that is at the moment.

This is just a sample of my XML into XMLTV plugin. If anybody knows what format that SageTV expects Season and Episode Input let me know.

Code:
  <programme start="20220116193000 +0000" stop="20220116200000 +0000" channel="6109">
    <title>Bizarre Foods: Delicious Destinations</title>
    <sub-title>San Francisco</sub-title>
    <desc>Dungeness Crab Louie and sourdough bread on the West Coast in San Francisco.</desc>
    <category>Episode</category>
    <category>Series</category>
    <category>Travel</category>
    <category>Cooking</category>
    <icon src="http://tmsimg.fancybits.co/assets/p11177369_b_h6_ai.jpg"></icon>
    <series-id system="tms">11177369</series-id>
    <date>20150706</date>
    <previously-shown></previously-shown>
    <episode-num system="tms">EP022364400015</episode-num>
    <episode-num system="onscreen">S2E1</episode-num>
    <episode-num system="xmltv_ns">1.0.</episode-num>
    <credits>
      <actor>Andrew Zimmern</actor>
    </credits>
  </programme>
__________________
Channels DVR UBUNTU Server 2 Primes 3 Connects TVE SageTV Docker with input from Channels DVR XMLTV and M3U VIA Opendct.

Last edited by nyplayer; 01-04-2022 at 06:41 PM.
Reply With Quote
  #7  
Old 01-13-2022, 09:17 PM
hvymetal hvymetal is offline
Sage Advanced User
 
Join Date: Nov 2007
Posts: 162
using last example the XML looks correct SageTV parse the following


Code:
    <episode-num system="tms">EP022364400015</episode-num>
    <episode-num system="onscreen">S2E1</episode-num>
    <episode-num system="xmltv_ns">1.0.</episode-num>
It uses the xmltv_ns which is zero based so

1 +1=Season 2
0+1=Episode 1

Not sure why it is failing based on the Java code it looks correct. Here is the code that manages it.

Code:
     
    /**
     * The regular expression for an XMLTV numbering system number.
     */
    private static final String RE_NS_PATTERN = "\\s*([0-9]+)?\\s*(?:/([0-9]+)?)?\\s*";

    /**
     * The regular expression for the XMLTV numbering system.
     */
    private static final Pattern RE_EPISODE_NUMBER_PATTERN = Pattern
            .compile(RE_NS_PATTERN
                    + "\\."
                    + RE_NS_PATTERN
                    + "\\."
                    + RE_NS_PATTERN);


* Sets the XMLTV numbering system number on the show.
     * 
     * @param aEpisodeNumber the XMLTV numbering system number.
     */
    private final void parseEpisodeNumber(String aEpisodeNumber) {
        if ("xmltv_ns".equals(this.system)) {
            Matcher matcher = RE_EPISODE_NUMBER_PATTERN.matcher(aEpisodeNumber);
            if (matcher.find()) {
                this.show.season = toInt(matcher.group(1), -1) + 1; // 0-based
                this.show.seasons = toInt(matcher.group(2), 0);
                this.show.episode = toInt(matcher.group(3), -1) + 1; // 0-based
                this.show.episodes = toInt(matcher.group(4), 0);
                this.show.part = toInt(matcher.group(5), -1) + 1; // 0-based
                this.show.parts = toInt(matcher.group(6), 0);
                if (this.show.season > 0 || this.show.episode > 0) {
                    // Create a free-form version of the episode number.
                    StringBuffer sb = new StringBuffer();
                    if (this.show.season > 0) {
                        sb.append(this.show.season + "-");
                    }
                    if (this.show.episode > 0) {
                        sb.append(this.show.episode);
                    }
                    this.show.freeFormEpisodeNumber = sb.toString();
                }
            } else {
                this.show.freeFormEpisodeNumber = aEpisodeNumber;
            }
        } else if ("dd_progid".equals(this.system)) {
            this.show.showId = aEpisodeNumber.replaceFirst("\\.", "");
        } else {
            this.show.freeFormEpisodeNumber = aEpisodeNumber;
        }
    }
Reply With Quote
  #8  
Old 01-13-2022, 10:02 PM
hvymetal hvymetal is offline
Sage Advanced User
 
Join Date: Nov 2007
Posts: 162
https://www.freeformatter.com/java-d...html#ad-output

https://code.sololearn.com/cVRUy2BwauK8

Java playground code to test example from above. You have to escape the string as it has quotes

Code:
import java.util.regex.Pattern;
import java.util.regex.Matcher;


class Playground {
        public static void main(String[ ] args) {


        int season;
        int seasons;
        int episode;
        int episodes;
        int part;
        int parts;

            String aEpisodeNumber="<episode-num system=\"xmltv_ns\">1.0.</episode-num>";
        Matcher matcher = RE_EPISODE_NUMBER_PATTERN.matcher(aEpisodeNumber);
        if (matcher.find()) {
            season = toInt(matcher.group(1), -1) + 1; // 0-based
            seasons = toInt(matcher.group(2), 0);
            episode = toInt(matcher.group(3), -1) + 1; // 0-based
            episodes = toInt(matcher.group(4), 0);
            part = toInt(matcher.group(5), -1) + 1; // 0-based
            parts = toInt(matcher.group(6), 0);
   
        System.out.println("season " + season );
        System.out.println("seasons " + seasons );
        System.out.println("episode " + episode );
        System.out.println("episodes " + episodes );
        System.out.println("part " + part);
        }
        }


    private static final int toInt(String aString, int aDefault) {
        return aString == null ? aDefault : Integer.parseInt(aString);
    }

    private static final Pattern LOWERCASE_WORDS_PATTERN = Pattern
        .compile(" ([\\p{Ll}]+)");

   private static final String RE_NS_PATTERN = "\\s*([0-9]+)?\\s*(?:/([0-9]+)?)?\\s*";

    /**
     * The regular expression for the XMLTV numbering system.
     */
    private static final Pattern RE_EPISODE_NUMBER_PATTERN = Pattern
            .compile(RE_NS_PATTERN
                    + "\\."
                    + RE_NS_PATTERN
                    + "\\."
                    + RE_NS_PATTERN);

}
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Now that Season and Episode are included ThePaladinTech SageTV Beta Test Software 2 04-20-2011 07:21 AM
Season/Episode Numbers with 7.1.3 Narflex SageTV Beta Test Software 11 03-11-2011 10:45 PM
Season/Episode in filename svalmorri SageMC Custom Interface 6 09-24-2009 09:42 PM
add Season and Episode numbers LoopyWolf SageTV Customizations 2 09-12-2009 01:41 PM
Season and episode information? CadErik SageTV EPG Service 7 10-03-2006 03:06 PM


All times are GMT -6. The time now is 11:06 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.