Skip to content

Commit

Permalink
Merge pull request #53 from mediathekview/develop
Browse files Browse the repository at this point in the history
Release 0.4.2
  • Loading branch information
tuxpoldo authored Jan 20, 2018
2 parents 2e03b81 + 585a195 commit 65e148f
Show file tree
Hide file tree
Showing 30 changed files with 55 additions and 20 deletions.
8 changes: 4 additions & 4 deletions addon.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,18 +297,18 @@ def Do( self ):
channel = self.args.get( 'channel', [0] )
self.db.GetRecents( channel[0], FilmUI( self ) )
elif mode[0] == 'recentchannels':
self.db.GetRecentChannels( ChannelUI( self.addon_handle, nextdir = 'recent' ) )
self.db.GetRecentChannels( ChannelUI( self, nextdir = 'recent' ) )
elif mode[0] == 'channels':
self.db.GetChannels( ChannelUI( self.addon_handle, nextdir = 'shows' ) )
self.db.GetChannels( ChannelUI( self, nextdir = 'shows' ) )
elif mode[0] == 'action-dbinfo':
self.showDbInfo()
elif mode[0] == 'initial':
channel = self.args.get( 'channel', [0] )
self.db.GetInitials( channel[0], InitialUI( self.addon_handle ) )
self.db.GetInitials( channel[0], InitialUI( self ) )
elif mode[0] == 'shows':
channel = self.args.get( 'channel', [0] )
initial = self.args.get( 'initial', [None] )
self.db.GetShows( channel[0], initial[0], ShowUI( self.addon_handle ) )
self.db.GetShows( channel[0], initial[0], ShowUI( self ) )
elif mode[0] == 'films':
show = self.args.get( 'show', [0] )
self.db.GetFilms( show[0], FilmUI( self ) )
Expand Down
9 changes: 7 additions & 2 deletions addon.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.mediathekview"
name="MediathekView"
version="0.4.1"
version="0.4.2"
provider-name="MediathekView.de, Leo Moll">
<requires>
<import addon="xbmc.python" version="2.25.0"/>
Expand All @@ -26,7 +26,12 @@
<description lang="de_DE">Ermöglicht den Zugriff auf fast alle deutschen Mediatheken der öffentlich Rechtlichen basierend auf der Datenbank von MediathekView.de</description>
<description lang="en_GB">Gives access to most video-platforms from German public service broadcasters using the database of MediathekView.de</description>
<description lang="it_IT">Fornisce l'accesso a gran parte delle piattaforme video operate dalle emittenti pubbliche tedesche usando la banca dati di MediathekView.de</description>
<news>v0.4.1 (2018-01-20):
<news>v0.4.2 (2018-01-20):
- Senderlogos werden nun in verschiedenen Situationen angezeigt
- Fehler bei Auflisten der Filme in "Alle Sendungen" aus 0.4.1 behoben
- Fehler bei Datenbankaktualisierung behoben
- Herunterladen von zufälligem Server
v0.4.1 (2018-01-20):
- Alphabetische Anzeige in Listen ist nun nicht mehr Groß-Klein-Sensitiv
- Download von Inhalten funktioniert wieder
- "Suchen nach Titel und Beschreibung" mit MySQL funktioniert wieder
Expand Down
Binary file added resources/icons/3sat-m.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/icons/ard-m.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/icons/arte.de-m.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/icons/arte.fr-m.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/icons/br-m.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/icons/default-m.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/icons/dw-m.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/icons/hr-m.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/icons/kika-m.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/icons/mdr-m.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/icons/ndr-m.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/icons/orf-m.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/icons/phoenix-m.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/icons/rbb-m.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/icons/sr-m.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/icons/srf-m.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/icons/srf.podcast-m.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/icons/swr-m.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/icons/wdr-m.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/icons/zdf-m.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/icons/zdf-tivi-m.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 8 additions & 2 deletions resources/lib/channelui.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@

# -- Classes ------------------------------------------------
class ChannelUI( Channel ):
def __init__( self, handle, sortmethods = None, nextdir = 'initial' ):
def __init__( self, plugin, sortmethods = None, nextdir = 'initial' ):
self.plugin = plugin
self.handle = plugin.addon_handle
self.nextdir = nextdir
self.handle = handle
self.sortmethods = sortmethods if sortmethods is not None else [ xbmcplugin.SORT_METHOD_TITLE ]
self.count = 0

Expand All @@ -25,6 +26,11 @@ def Begin( self ):
def Add( self, altname = None ):
resultingname = self.channel if self.count == 0 else '%s (%d)' % ( self.channel, self.count, )
li = xbmcgui.ListItem( label = resultingname if altname is None else altname )
icon = 'special://home/addons/' + self.plugin.addon_id + '/resources/icons/' + self.channel.lower() + '-m.png'
li.setArt( {
'thumb': icon,
'icon': icon
} )
xbmcplugin.addDirectoryItem(
handle = self.handle,
url = mvutils.build_url( {
Expand Down
6 changes: 6 additions & 0 deletions resources/lib/filmui.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,15 @@ def Add( self, alttitle = None, totalItems = None ):
infoLabels['aired'] = airedstring
infoLabels['dateadded'] = airedstring

icon = 'special://home/addons/' + self.plugin.addon_id + '/resources/icons/' + self.channel.lower() + '-m.png'

li = xbmcgui.ListItem( resultingtitle )
li.setInfo( type = 'video', infoLabels = infoLabels )
li.setProperty( 'IsPlayable', 'true' )
li.setArt( {
'thumb': icon,
'icon': icon
} )

# create context menu
contextmenu = []
Expand Down
5 changes: 3 additions & 2 deletions resources/lib/initialui.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@

# -- Classes ------------------------------------------------
class InitialUI( object ):
def __init__( self, handle, sortmethods = None ):
self.handle = handle
def __init__( self, plugin, sortmethods = None ):
self.plugin = plugin
self.handle = plugin.addon_handle
self.sortmethods = sortmethods if sortmethods is not None else [ xbmcplugin.SORT_METHOD_TITLE ]
self.channelid = 0
self.initial = ''
Expand Down
19 changes: 15 additions & 4 deletions resources/lib/showui.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,21 @@

# -- Classes ------------------------------------------------
class ShowUI( Show ):
def __init__( self, handle, sortmethods = None ):
self.handle = handle
def __init__( self, plugin, sortmethods = None ):
self.plugin = plugin
self.handle = plugin.addon_handle
self.sortmethods = sortmethods if sortmethods is not None else [ xbmcplugin.SORT_METHOD_TITLE ]
self.querychannelid = 0

def Begin( self, channelid ):
self.querychannelid = channelid
self.querychannelid = int( channelid )
for method in self.sortmethods:
xbmcplugin.addSortMethod( self.handle, method )

def Add( self, altname = None ):
if altname is not None:
resultingname = altname
elif self.querychannelid == '0':
elif self.querychannelid == 0:
resultingname = self.show + ' [' + self.channel + ']'
else:
resultingname = self.show
Expand All @@ -35,8 +36,18 @@ def Add( self, altname = None ):
'sorttitle' : resultingname.lower()
}


if self.channel.find( ',' ) == -1:
icon = 'special://home/addons/' + self.plugin.addon_id + '/resources/icons/' + self.channel.lower() + '-m.png'
else:
icon = 'special://home/addons/' + self.plugin.addon_id + '/resources/icons/default-m.png'

li = xbmcgui.ListItem( label = resultingname )
li.setInfo( type = 'video', infoLabels = infoLabels )
li.setArt( {
'thumb': icon,
'icon': icon
} )

xbmcplugin.addDirectoryItem(
handle = self.handle,
Expand Down
2 changes: 1 addition & 1 deletion resources/lib/storemysql.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def GetFilms( self, showid, filmui ):
self._Search_Condition( '( `showid` = %s )', ( int( showid ), ), filmui, False, False, 10000 )
else:
# multiple channel ids
self._Search_Condition( '( `showid` IN ( %s ) )', ( showid, ), filmui, False, True, 10000 )
self._Search_Condition( '( `showid` IN ( {} ) )'.format( showid ), (), filmui, False, True, 10000 )

def _Channels_Condition( self, condition, channelui):
if self.conn is None:
Expand Down
2 changes: 1 addition & 1 deletion resources/lib/storesqlite.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def GetFilms( self, showid, filmui ):
self._Search_Condition( '( showid=? )', ( int( showid ), ), filmui, False, False, 10000 )
else:
# multiple channel ids
self._Search_Condition( '( showid IN ( ? ) )', ( showid, ), filmui, False, True, 10000 )
self._Search_Condition( '( showid IN ( {} ) )'.format( showid ), (), filmui, False, True, 10000 )

def _Channels_Condition( self, condition, channelui ):
if self.conn is None:
Expand Down
14 changes: 10 additions & 4 deletions resources/lib/updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@
# Copyright (c) 2017-2018, Leo Moll

# -- Imports ------------------------------------------------
import os, urllib2, subprocess, ijson, datetime, time
import defusedxml.ElementTree as etree
import os
import time
import ijson
import random
import urllib2
import datetime
import subprocess

import defusedxml.ElementTree as etree
import resources.lib.mvutils as mvutils

from operator import itemgetter
Expand Down Expand Up @@ -179,7 +185,7 @@ def Import( self, full ):
except DatabaseLost as err:
self.logger.error( '{}', err )
self.notifier.CloseUpdateProgress()
except IOError as err:
except Exception as err:
self.logger.error( 'Error {} wile processing {}', err, destfile )
self._update_end( full, 'ABORTED' )
self.notifier.CloseUpdateProgress()
Expand All @@ -206,7 +212,7 @@ def GetNewestList( self, full ):
try:
URL = server.find( 'URL' ).text
Prio = server.find( 'Prio' ).text
urls.append( ( self._get_update_url( URL ), Prio ) )
urls.append( ( self._get_update_url( URL ), float( Prio ) + random.random() * 1.2 ) )
self.logger.info( 'Found mirror {} (Priority {})', URL, Prio )
except AttributeError:
pass
Expand Down

0 comments on commit 65e148f

Please sign in to comment.