Skip to content

Commit

Permalink
Updated backend code to python3 and fixed audio fade issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dex Burgess committed Nov 10, 2021
1 parent fae9267 commit e1c2cd8
Show file tree
Hide file tree
Showing 272 changed files with 4,302 additions and 54,919 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Create a completely customizable sequence of trivia slides, video bumpers, trail
## Getting Started

## Prerequisites
You must have a working install of [Kodi](http://kodi.tv/) to use this add-on.
You must have a working install of [Kodi](http://kodi.tv/) 19 or above to use this version of the add-on.

## Installing
All of the CinemaVision add-ons are available for download via the official Kodi repository. Development releases can be downloaded from the [CinemaVision.tv](http://cinemavision.tv/) website, which contain work-in-progress features and fixes.
Expand Down
70 changes: 0 additions & 70 deletions addon.py

This file was deleted.

50 changes: 26 additions & 24 deletions addon.xml
Original file line number Diff line number Diff line change
@@ -1,51 +1,53 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="script.cinemavision" name="CinemaVision" version="1.1.1" provider-name="CinemaVision">
<addon id="script.cinemavision" name="CinemaVision" version="1.5.1" provider-name="CinemaVision">
<requires>
<import addon="xbmc.python" version="2.14.0"/>
<import addon="script.module.youtube.dl" version="15.318.0"/>
<import addon="script.module.beautifulsoup" version="3.0.8"/>
<import addon="script.module.requests" version="2.3.0"/>
<import addon="xbmc.python" version="3.0.0"/>
<import addon="script.module.youtube.dl" version="21.303.0"/>
<import addon="script.module.beautifulsoup4" version="4.9.3"/>
<import addon="script.module.requests" version="2.22.0.1"/>
</requires>
<extension point="xbmc.python.script" library="addon.py">
<extension point="xbmc.python.script" library="cinemavision.py" start="startup">
<provides>executable</provides>
</extension>
<extension point="kodi.context.item">
<menu id="kodi.core.main">
<item library="cinemavision_menu.py">
<label>32000</label>
<visible>Container.Content(movies) | Container.Content(episodes) | Container.Content(seasons) | Container.Content(tvshows) | Container.Content(playlists)</visible>
</item>
</menu>
</extension>
<extension point="xbmc.addon.metadata">
<summary lang="en">Create a movie theater experience in the comfort of your own home!</summary>
<summary lang="fr">Créez une expérience de cinéma dans le confort de votre maison!</summary>
<summary lang="es">Crear una experiencia de cine en la comodidad de su propia casa!</summary>
<summary lang="de">Erstellen Sie ein Kinoerlebnis in den Komfort der Ihren eigenen vier Wänden!</summary>
<summary lang="pt_BR">Crie uma experiência de cinema no conforto da sua própria casa!</summary>
<summary lang="pt">Crie uma experiência de cinema no conforto da sua própria casa!</summary>
<summary lang="pt-br">Crie uma experiência de cinema no conforto da sua própria casa!</summary>
<description lang="en">Create a completely customizable sequence of trivia slides, video bumpers, trailers and much more that will bring the experience of a movie theater straight to your home theater. Easily control your RESTful home automation solutions to create your perfect theater ambiance. Share your sequences, download content and collaborate online at CinemaVision.tv!</description>
<description lang="fr">Créez une séquence complètement personnalisable de diapositives, de pare-chocs vidéo, de bandes-annonces et bien d'autres choses qui apporteront l'expérience d'un cinéma directement à votre home cinéma. Contrôlez facilement vos solutions de domotique RESTful pour créer votre ambiance de théâtre parfaite. Partagez vos séquences, téléchargez le contenu et collaborez en ligne sur CinemaVision.tv!</description>
<description lang="es">Cree una secuencia completamente personalizable de diapositivas trivia, parachoques de video, trailers y mucho más que traerá la experiencia de un cine directamente a su cine en casa. Controle fácilmente sus soluciones RESTful de automatización del hogar para crear su ambiente de teatro perfecto. Comparte tus secuencias, descarga contenido y colabora online en CinemaVision.tv!</description>
<description lang="de">Erstellen Sie eine vollständig anpassbare Sequenz von Trivia-Folien, Video-Stoßfänger, Trailer und vieles mehr, die die Erfahrung eines Kino direkt zu Ihrem Heimkino bringen wird. Einfache Kontrolle Ihrer RESTful Hausautomation Lösungen, um Ihre perfekte Theater Ambiente zu schaffen. Teilen Sie Ihre Sequenzen, laden Sie Inhalte herunter und arbeiten Sie online bei CinemaVision.tv zusammen!</description>
<description lang="pt_BR">Crie uma seqüência completamente customizável de slides de trivia, amortecedores de vídeo, trailers e muito mais que trará a experiência de um cinema diretamente para seu home theater. Controle facilmente suas soluções de automação residencial RESTful para criar seu ambiente de teatro perfeito. Compartilhe suas seqüências, baixe conteúdo e colabore online no CinemaVision.tv!</description>
<description lang="pt">Crie uma sequência completamente personalizada de slides de trivia, pequenos vídeos, trailers e muito mais que trará a experiência de um cinema directamente para seu home theater. Controle facilmente as suas soluções de automação residencial RESTful para criar o seu ambiente de cinema perfeito. Partilhe as suas sequências, baixe conteúdo e colabore online em CinemaVision.tv!</description>
<description lang="pt-br">Crie uma seqüência completamente customizável de slides de trivia, amortecedores de vídeo, trailers e muito mais que trará a experiência de um cinema diretamente para seu home theater. Controle facilmente suas soluções de automação residencial RESTful para criar seu ambiente de teatro perfeito. Compartilhe suas seqüências, baixe conteúdo e colabore online no CinemaVision.tv!</description>
<disclaimer lang="en">This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. Visit the website for details.</disclaimer>
<disclaimer lang="fr">Ce travail est autorisé sous licence Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. Visitez le site pour plus de détails.</disclaimer>
<disclaimer lang="es">Esta obra está bajo una licencia internacional Creative Commons Attribution-NonCommercial-ShareAlike 4.0. Visite el sitio web para más detalles.</disclaimer>
<disclaimer lang="de">Diese Seite ist unter einer Creative Commons Attribution-NonCommercial-ShareAlike 4.0 Internationale lizensiert. Besuchen Sie die Website für weitere Details.</disclaimer>
<disclaimer lang="pt_BR">Esta obra está licenciada sob uma Licença Internacional Creative Commons Attribution-Noncommercial-Share Alike 4.0. Visite o site para mais detalhes.</disclaimer>
<disclaimer lang="pt">Esta obra está licenciada sob uma Licença Internacional Creative Commons Attribution-Noncommercial-Share Alike 4.0. Visite o site para mais detalhes.</disclaimer>
<disclaimer lang="pt-br">Esta obra está licenciada sob uma Licença Internacional Creative Commons Attribution-Noncommercial-Share Alike 4.0. Visite o site para mais detalhes.</disclaimer>
<platform>all</platform>
<license>Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International</license>
<forum>https://cinemavision.tv/forums</forum>
<website>https://cinemavision.tv/</website>
<forum>http://www.cinemavision.tv/forums/</forum>
<website>http://www.cinemavision.tv/</website>
<source>https://github.com/CinemaVision/script.cinemavision</source>
<assets>
<icon>icon.png</icon>
<screenshot>resources/screenshots/screenshot00.png</screenshot>
<screenshot>resources/screenshots/screenshot01.png</screenshot>
<screenshot>resources/screenshots/screenshot02.png</screenshot>
<screenshot>resources/screenshots/screenshot1.png</screenshot>
<screenshot>resources/screenshots/screenshot2.png</screenshot>
<screenshot>resources/screenshots/screenshot3.png</screenshot>
</assets>
<news>change: Enhanced user interface
add: Ability to change interface theme
add: TMDB trailer scraper
fix: Compatibility fixes for Kodi v18
add: Actions: Added ID to http requests to help match request to response
add: Actions: Improve sleep:// handling
add: Actions: Improve testing
change: Actions: python:// is now used for inline python statements, script:// for executing a python file
add: Trailers: Content scraper will now read genre and rating from .nfo files
add: Support for special:// content paths - Issue #124
<news>Updated backend code to python3 for use within Kodi 19 Matrix and above.
</news>
</extension>
</addon>
11 changes: 11 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
Changelog for CinemaVision

[- 1.5.1 -]
-change: Combined the context menu code within the main plugin

[- 1.5.0 -]

- fix: Updated code to work with Kodi 19 Matrix / Python3
- fix: Resolved issue with demo video urls
- change: Updated context menu display for movie run time in hour, min, seconds
- fix: Audio fades correctly during trivia slides
- fix: Ability to add Action files from a SMB or NFS path

[- 1.1.1 -]

- change: Enhanced user interface
Expand Down
12 changes: 6 additions & 6 deletions lib/cinemavision/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import included_packages
from . import included_packages

import util
import content
import sequence
import actions
import sequenceprocessor
from . import util
from . import content
from . import sequence
from . import actions
from . import sequenceprocessor


def init(debug, progress=None, localizer=None, tags_3D_regex=''):
Expand Down
15 changes: 8 additions & 7 deletions lib/cinemavision/actions.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import os
import sys
import util
from . import util
import threading
import traceback
import importlib


class ActionCommand:
Expand Down Expand Up @@ -74,7 +75,7 @@ def _threadedExecute(self):

self.log('Action (Sleep) Start: {0} ({1})'.format(self.commandData, now))

while not xbmc.abortRequested and now < end and xbmc.getInfoLabel('Window(10000).Property(script.cinemavision.running)'):
while not xbmc.Monitor().abortRequested and now < end and xbmc.getInfoLabel('Window(10000).Property(script.cinemavision.running)'):
xbmc.sleep(ms)
now = time.time()
ms = min(int((end - now) * 1000), 200)
Expand Down Expand Up @@ -116,7 +117,7 @@ def execute(self):
sys.path.append(self.importPath)

import cinema_vision_command_module
reload(cinema_vision_command_module)
importlib.reload(cinema_vision_command_module)

result = cinema_vision_command_module.main(*self.args)
self.log('Action (Module) Succeded: {0} ({1}) - Result: {2}'.format(self.commandData, ', '.join(self.args), result))
Expand Down Expand Up @@ -302,9 +303,9 @@ def logParseErrorLine(self, msg, type_):
self.parserLog.append((type_, msg))

def parseError(self, msg, line, lineno, type_='ERROR'):
self.logParseErrorLine(u'ACTION {0} (line {1}): {2}'.format(type_, lineno, repr(self.path).lstrip('u').strip("'")), type_)
self.logParseErrorLine(u'{0}'.format(repr(line)), type_)
self.logParseErrorLine(u'{0}'.format(msg), type_)
self.logParseErrorLine('ACTION {0} (line {1}): {2}'.format(type_, lineno, repr(self.path).lstrip('u').strip("'")), type_)
self.logParseErrorLine('{0}'.format(repr(line)), type_)
self.logParseErrorLine('{0}'.format(msg), type_)

def init(self):
try:
Expand Down Expand Up @@ -389,7 +390,7 @@ def _loadCommands(self):
command = self.commandClasses[name](data)
command.setPath(self.path)
else:
self.parseError(u'Unrecognized command protocol: {0}'.format(repr(name)), line, lineno)
self.parseError('Unrecognized command protocol: {0}'.format(repr(name)), line, lineno)
return
else:
if command:
Expand Down
22 changes: 11 additions & 11 deletions lib/cinemavision/content.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
import re
from xml.etree import ElementTree as ET

import util
from . import util
import mutagen
import hachoir
import database as DB
from . import database as DB
import datetime

try:
Expand Down Expand Up @@ -36,7 +36,7 @@


def getBumperDir(ID):
for dirname, tid in TYPE_IDS.items():
for dirname, tid in list(TYPE_IDS.items()):
if tid == ID:
break
else:
Expand Down Expand Up @@ -228,8 +228,6 @@ def loadTrivia(self):
if sub.startswith('_Exclude'):
util.DEBUG_LOG('SKIPPING EXCLUDED DIR: {0}'.format(util.strRepr(sub)))
continue
else:
continue

self.log('Processing trivia: {0}'.format(util.strRepr(os.path.basename(path))))
self.triviaDirectoryHandler(path, prefix=sub)
Expand Down Expand Up @@ -327,11 +325,11 @@ def addBumper(self, model, sub, path, type_name, sub_name, type_, sub_default, s
)

def loadRatingSystem(self, path):
import ratings
from . import ratings
with util.vfs.File(path, 'r') as f:
system = ratings.addRatingSystemFromXML(f.read())

for context, regEx in system.regEx.items():
for context, regEx in list(system.regEx.items()):
DB.RatingSystem.get_or_create(
name=system.name,
context=context,
Expand All @@ -355,7 +353,7 @@ def scrapeContent(self):
util.ERROR()

def _scrapeContent(self):
import scrapers
from . import scrapers
scrapers.setContentPath(self._contentDirectory)

for stype, source in util.contentScrapers():
Expand Down Expand Up @@ -385,6 +383,7 @@ def _scrapeContent(self):
except DB.peewee.DoesNotExist:
ct += 1
url = t.getStaticURL()
#util.DEBUG_LOG(url)
DB.Trailers.create(
WID=t.ID,
source=source,
Expand Down Expand Up @@ -506,6 +505,7 @@ def __call__(self, basePath, prefix=None):
def doCall(self, basePath, prefix=None):
hasSlidesXML = False
slideXML = util.pathJoin(basePath, self._formatXML)
# util.DEBUG_LOG(basePath)
if util.vfs.exists(slideXML):
hasSlidesXML = True

Expand Down Expand Up @@ -593,7 +593,7 @@ def doCall(self, basePath, prefix=None):
elif ttype == 'c':
trivia[name]['c'][clueCount] = path

for name, data in trivia.items():
for name, data in list(trivia.items()):
questionPath = data['q']
answerPath = data['a']

Expand All @@ -609,7 +609,7 @@ def doCall(self, basePath, prefix=None):

defaults = {
'type': ttype,
'TID': u'{0}:{1}'.format(prefix, name),
'TID': '{0}:{1}'.format(prefix, name),
'name': name,
'rating': rating,
'questionPath': questionPath
Expand Down Expand Up @@ -663,7 +663,7 @@ def getSlide(self, path, c, pack=''):
answerPath=path,
defaults={
'type': ttype,
'TID': u'{0}:{1}'.format(pack, name),
'TID': '{0}:{1}'.format(pack, name),
'name': name,
'duration': duration
}
Expand Down
2 changes: 1 addition & 1 deletion lib/cinemavision/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def strptime(cls, dstring, dformat):
datetime.datetime = new_datetime

from peewee import peewee # pylint: disable=E0401
import util
from . import util

DATABASE_VERSION = 6

Expand Down
14 changes: 2 additions & 12 deletions lib/cinemavision/included_packages/hachoir/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,2 @@
import os
import sys
import inspect

# Include this hachoir folder in sys.path so included libs will import properly
cmd_folder = os.path.realpath(os.path.abspath(os.path.split(inspect.getfile(inspect.currentframe()))[0]))
if cmd_folder not in sys.path:
sys.path.insert(0, cmd_folder)

import hachoir_core
import hachoir_parser
import hachoir_metadata
VERSION = (3, 1, 3)
__version__ = ".".join(map(str, VERSION))

This file was deleted.

Loading

0 comments on commit e1c2cd8

Please sign in to comment.