XBMC Community Forum
Icefilms (Icefilms.info) Addon Development Thread - Printable Version

+- XBMC Community Forum (http://forum.xbmc.org)
+-- Forum: Development (/forumdisplay.php?fid=32)
+--- Forum: Python Add-on Development (/forumdisplay.php?fid=26)
+--- Thread: Icefilms (Icefilms.info) Addon Development Thread (/showthread.php?tid=90315)



- rogerthis - 2011-12-23 12:07

Setup fresh install on XP and getting this error on startup:
http://pastebin.com/571d6FBU


- rogerthis - 2011-12-23 12:15

I have it working on a different PC.
It looking better at every release. Loving the banner look for TV.

So, for today's issues: not all the banners were downloaded, there is about 10 missing from the 150 of popular TV. Any chance of a new more complete banners download?

I have been looking at the breadcrumbs for TV. It doesn't display the TV Show name at the top at all. It will show the Season number, without TV Show name, when browsing episodes. I believe the problem stems from metahandler. For Season and Episode there is no option for TV Show name. If we get the TV Show name into Season and Episode, I think the breadcrumbs will populate.

BUG: Function MOVIEA2ZDirectories lists the a to z twice.

Auto-view should be enabled my default.

If anybody is wondering, it plays all the files. It more cosmetic issues at the moment. We need more testers.


- zpanderson - 2011-12-23 16:22

rogerthis Wrote:Setup fresh install on XP and getting this error on startup:
http://pastebin.com/571d6FBU

Looks like it's trying to add the extra columns that have recently been added, except you don't have any db because it is a fresh install so it fails.


- Eldorado - 2011-12-23 21:28

zpanderson Wrote:.5 has caused my fanart to stop displaying... any ideas?

Fanart or covers? I noticed afterwards I set the defaults in the settings for the 2 new cover options to be false by accident.. can you double check your settings?


- Eldorado - 2011-12-23 21:31

zpanderson Wrote:Looks like it's trying to add the extra columns that have recently been added, except you don't have any db because it is a fresh install so it fails.

Yeah crap.. I didn't consider that scenario.. or actually I did in my mind but never made it to my keyboard Smile

Roger, if you want to do a manual fix you can edit the metahandler.py file and in the __init__ method you will see 2 blocks of code that I've commented as being temporary, for your fresh install you can just delete those 2 chunks

I'll put out a quick .6 to correct this


- Eldorado - 2011-12-23 21:37

rogerthis Wrote:I have it working on a different PC.
It looking better at every release. Loving the banner look for TV.

So, for today's issues: not all the banners were downloaded, there is about 10 missing from the 150 of popular TV. Any chance of a new more complete banners download?

I have been looking at the breadcrumbs for TV. It doesn't display the TV Show name at the top at all. It will show the Season number, without TV Show name, when browsing episodes. I believe the problem stems from metahandler. For Season and Episode there is no option for TV Show name. If we get the TV Show name into Season and Episode, I think the breadcrumbs will populate.

BUG: Function MOVIEA2ZDirectories lists the a to z twice.

Auto-view should be enabled my default.

If anybody is wondering, it plays all the files. It more cosmetic issues at the moment. We need more testers.

All banners were downloaded, if some are missing it's either due to a) a banner doesn't exist on TVDB or b) if one does it exist then metahandler's is somehow missing it which the way the code is done should be very hard to do.. can you give some examples of those missing and double check if one does exist on TVDB?

Where are you seeing the breadcrumbs?

Thanks, will check out the a-z stuff

Auto-view can't be enabled by default, the numbers in those views are skin dependent.. we put in default values for Confluence, but can't assume everyone uses it.. the numbers vary by skin, so we have the default view value


- rogerthis - 2011-12-23 22:27

Eldorado Wrote:All banners were downloaded, if some are missing it's either due to a) a banner doesn't exist on TVDB or b) if one does it exist then metahandler's is somehow missing it which the way the code is done should be very hard to do.. can you give some examples of those missing and double check if one does exist on TVDB?

Missing banner for all these:
Family Guy, Supernatural, Always sunny, Grey's Anatomy, Glee, Game of Thrones, The Walking Dead, Top Gear, Desperate Housewives, Doctor who,
L&O: SVU, Nikita, Star Trek: Voyager

Got around half way through the list of 150

Edit: plus 9 more for the rest, sorry got lazy writing the names

Eldorado Wrote:Where are you seeing the breadcrumbs?
[Image: viewposter14.png]
You can also see that the episodes images aren't coming up.

Eldorado Wrote:Thanks, will check out the a-z stuff

Auto-view can't be enabled by default, the numbers in those views are skin dependent.. we put in default values for Confluence, but can't assume everyone uses it.. the numbers vary by skin, so we have the default view value

Auto-view is so good, it should be enable by default. Let people turn it off if they have a different skin.


- zpanderson - 2011-12-23 22:38

Eldorado Wrote:Fanart or covers? I noticed afterwards I set the defaults in the settings for the 2 new cover options to be false by accident.. can you double check your settings?

Covers are working fine, but fanart for tv shows only is no longer displayed. Movie fanart is working which is why I'm so confused. I checked and both settings are enabled.

Code:
<setting id="tv-covers" value="true" />
    <setting id="tv-fanart" value="true" />
    <setting id="tv-posters" value="true" />

As for enabling auto-view by default, I agree with Eldorado. It is something that has to be set by each individual to suit their wants/needs.


- rogerthis - 2011-12-23 22:49

zpanderson Wrote:As for enabling auto-view by default, I agree with Eldorado. It is something that has to be set by each individual to suit their wants/needs.

Fair point, but I think it one of the mayor plus's.

Does anybody know about the Switch off library mode? In ndeshmukh's mod it has been taken out, and nobody has complained.

Would it be a big job to add the extra info into Recently Added and so you see the "Added Today", ''Added Yesterday" etc It would make these menu a lot more useful. For the regex, you find all the movies link, and it skips the "Added Yesterday", but can you regex for the "Added" and find the movies in between? Can you put up text without it being a link?


- zpanderson - 2011-12-24 03:24

rogerthis Wrote:Fair point, but I think it one of the mayor plus's.

Does anybody know about the Switch off library mode? In ndeshmukh's mod it has been taken out, and nobody has complained.

Would it be a big job to add the extra info into Recently Added and so you see the "Added Today", ''Added Yesterday" etc It would make these menu a lot more useful. For the regex, you find all the movies link, and it skips the "Added Yesterday", but can you regex for the "Added" and find the movies in between? Can you put up text without it being a link?

Yeah looks like its not too hard to do. The text would still be clickable but would just direct you to a blank screen if clicked. It would look weird on anything that shows posters though.

Here is the code that would do it... replace def recent and def latest and see if it's what you're thinking.

Code:
def RECENT(url):
        link=GetURL(url)
        #initialise meta class before loop
        if meta_setting=='true':
            metaget=metahandlers.MetaData(preparezip=prepare_zip)
            meta_installed = metaget.check_meta_installed(addon_id)
        else:
            meta_installed = False
              
        homepage=re.compile('<h1>Recently Added</h1>(.+?)<h1>Statistics</h1>', re.DOTALL).findall(link)
        for scrape in homepage:
                scrape='<h1>Recently Added</h1>'+scrape+'<h1>Statistics</h1>'
                recadd=re.compile('<h1>Recently Added</h1>(.+?)<h1>Latest Releases</h1>', re.DOTALL).findall(scrape)
                for scraped in recadd:
                        text = re.compile("<span style='font-size:14px;'>(.+?)<br>").findall(scraped)
                        #Add the first line
                        VaddDir('***** ' + text[0], '', 0, '')
                        tmp=re.compile('<br>(.+?)<br>').findall(scraped)
                        for entry in tmp:
                            mirlinks=re.compile('<a href=/(.+?)>(.+?)</a>').findall(entry)
                            if mirlinks:                    
                                for url,name in mirlinks:
                                    url=iceurl+url
                                    name=CLEANUP(name)

                                    if check_episode(name):
                                        mode = 14
                                    else:
                                        mode = 100
                                                                        
                                    if meta_installed and meta_setting=='true':
                                        meta = check_video_meta(name, metaget)
                                        addDir(name,url,mode,'',meta=meta,disablefav=True, disablewatch=True, meta_install=meta_installed)
                                    else:
                                        addDir(name,url,mode,'',disablefav=True, disablewatch=True)
                            else:
                                VaddDir('***** ' + entry, '', 0,  '')
        setView(None, 'default-view')                                    
        
def LATEST(url):
        link=GetURL(url)
        
        #initialise meta class before loop
        if meta_setting=='true':
            metaget=metahandlers.MetaData(preparezip=prepare_zip)
            meta_installed = metaget.check_meta_installed(addon_id)
        else:
            meta_installed = False
                    
        homepage=re.compile('<h1>Recently Added</h1>(.+?)<h1>Statistics</h1>', re.DOTALL).findall(link)
        for scrape in homepage:
                scrape='<h1>Recently Added</h1>'+scrape+'<h1>Statistics</h1>'
                latrel=re.compile('<h1>Latest Releases</h1>(.+?)<h1>Being Watched Now</h1>', re.DOTALL).findall(scrape)
                for scraped in latrel:
                    text = re.compile("<span style='font-size:14px;'>(.+?)<br>").findall(scraped)
                    #Add the first line
                    VaddDir('***** ' + text[0], '', 0, '')
                    tmp=re.compile('r>(.+?)<b').findall(scraped)
                    for entry in tmp:
                        mirlinks=re.compile('<a href=/(.+?)>(.+?)</a>').findall(entry)
                        if mirlinks:                    
                            for url,name in mirlinks:
                                url=iceurl+url
                                name=CLEANUP(name)

                                if check_episode(name):
                                    mode = 14
                                else:
                                    mode = 100
                                                                    
                                if meta_installed and meta_setting=='true':
                                    meta = check_video_meta(name, metaget)
                                    addDir(name,url,mode,'',meta=meta,disablefav=True, disablewatch=True, meta_install=meta_installed)
                                else:
                                    addDir(name,url,mode,'',disablefav=True, disablewatch=True)
                        else:
                            VaddDir('***** ' + entry, '', 0,  '')
        setView(None, 'default-view')

That's only for the homepage, to do it for the movie/tv show pages it looks like it'll be harder since we're using movieindex and tvindex.

Code:
def MOVIEINDEX(url):
    #Indexer for most things. (Movies,Music,Stand-up etc)
    link=GetURL(url)
    
    # we do this to fix the problem when there is no imdb_id.
    # I have found only one movie with this problem, but we must check this...
    link = re.sub('<a name=i id=>','<a name=i id=None>',link)
    #Display the first date and movie that won't be shown otherwise....
    firstText= re.compile('<h3>(.+?)</h3>').findall(link)
    if firstText:
        VaddDir('***** ' + firstText[0], '', 0, '')
    scrape=re.compile('<a name=i id=(.+?)></a><img class=star><a href=/(.+?)>(.+?)<br>').findall(link)
    tmplist = []
    tmplist.append(scrape[0])
    getMeta(tmplist, 100)
    
    #Break the remaining source into seperate lines and check if it contains a date
    temp = re.compile('r>(.+?)<b').findall(link)
    for entry in temp:
        text = re.compile('<h3>(.+?)</h3>').findall(entry)
        if text:
            VaddDir('***** ' + text[0], '', 0, '')
        scrape=re.compile('<a name=i id=(.+?)></a><img class=star><a href=/(.+?)>(.+?)</a>').findall(entry)
        if scrape:
            getMeta(scrape, 100)
    
    # Enable library mode & set the right view for the content
    setView('movies', 'movies-view')

That'll add it to all the movie categories including popular/latest release/recently added

Code:
def TVINDEX(url):
    #Indexer for TV Shows only.

    link=GetURL(url)

    #list scraper now tries to get number of episodes on icefilms for show. this only works in A-Z.
    #match=re.compile('<a name=i id=(.+?)></a><img class=star><a href=/(.+?)>(.+?)</a>').findall(link)
    firstText = re.compile('<h3>(.+?)</h3>').findall(link)
    if firstText:
        VaddDir('***** ' + firstText[0], '', 0, '')
    scrape=re.compile('<a name=i id=(.+?)></a><img class=star><a href=/(.+?)>(.+?)<br>').findall(link)
    tmplist = []
    tmplist.append(scrape[0])
    getMeta(tmplist, 12)
    
    #Break the remaining source into seperate lines and check if it contains a text entry
    temp = re.compile('r>(.+?)<b').findall(link)
    for entry in temp:
        text = re.compile('<h3>(.+?)</h3>').findall(entry)
        if text:
            VaddDir('***** ' + text[0], '', 0, '')
        scrape=re.compile('<a name=i id=(.+?)></a><img class=star><a href=/(.+?)>(.+?)</a>').findall(entry)
        if scrape:
            getMeta(scrape, 12)
    
    # Enable library mode & set the right view for the content
    setView('tvshows', 'tvshows-view')

That'll add it to all the tv categories including popular/latest release/recently added

Also had to fiddle with def getmeta because these scrapes only returned 3 values and getmeta expects 4 when talking about number of episodes. So I just commented it out until I could think on it some more.

Code:
def getMeta(scrape, mode):

    #check settings over whether to display the number of episodes next to tv show name.
    show_num_of_eps='false'
    
    print scrape

    #add with metadata
    if meta_setting=='true':
    
        #initialise meta class before loop
        metaget=metahandlers.MetaData(preparezip=prepare_zip)
        meta_installed = metaget.check_meta_installed(addon_id)

        #determine whether to show number of eps
        # if scrape[3] and show_num_of_eps == 'true' and mode == 12:
            # for imdb_id,url,name,num_of_eps in scrape:
                # num_of_eps=re.sub('<','',num_of_eps)
                # num_of_eps=re.sub('isode','',num_of_eps)#turn Episode{s} into Ep(s)
                # ADD_ITEM(metaget,meta_installed,imdb_id,url,name,mode,num_of_eps, totalitems=len(scrape))
        # elif mode == 12: # fix for tvshows with num of episodes disabled
            # for imdb_id,url,name, blank in scrape:
                # ADD_ITEM(metaget,meta_installed,imdb_id,url,name,mode, totalitems=len(scrape))
        # else:
        for imdb_id,url,name in scrape:
            ADD_ITEM(metaget,meta_installed,imdb_id,url,name,mode, totalitems=len(scrape))
                
    #add without metadata -- imdb is still passed for use with Add to Favourites
    else:
        for imdb_id,url,name in scrape:
            name=CLEANUP(name)
            addDir(name,iceurl+url,mode,'',imdb='tt'+str(imdb_id), totalItems=len(scrape))