Skip to content

Commit

Permalink
Algunas traducciones
Browse files Browse the repository at this point in the history
  • Loading branch information
pablouser1 committed Jun 29, 2022
1 parent 6e656e0 commit 67f7679
Show file tree
Hide file tree
Showing 7 changed files with 96 additions and 18 deletions.
2 changes: 1 addition & 1 deletion addon.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.filmin" name="Filmin" version="1.4.1" provider-name="pablouser1">
<addon id="plugin.video.filmin" name="Filmin" version="1.4.2" provider-name="pablouser1">
<requires>
<import addon="xbmc.python" version="3.0.0" />
<import addon="script.module.requests" version="2.22.0+matrix.1" />
Expand Down
40 changes: 40 additions & 0 deletions resources/language/resource.language.en_gb/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,43 @@ msgstr ""
msgctxt "#40012"
msgid "User ID"
msgstr ""

msgctxt "#40013"
msgid "Search"
msgstr ""

msgctxt "#40014"
msgid "Catalog"
msgstr ""

msgctxt "#40015"
msgid "Purchaseds"
msgstr ""

msgctxt "#40016"
msgid "Highlighteds"
msgstr ""

msgctxt "#40017"
msgid "Collections"
msgstr ""

msgctxt "#40018"
msgid "Watching"
msgstr ""

msgctxt "#40019"
msgid "My playlists"
msgstr ""

msgctxt "#40020"
msgid "Type your username/email"
msgstr ""

msgctxt "#40021"
msgid "Type your password"
msgstr ""

msgctxt "#40022"
msgid "Logged in successfully"
msgstr ""
36 changes: 36 additions & 0 deletions resources/language/resource.language.es_es/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,39 @@ msgstr "Habilitar integración con Up Next"
msgctxt "#40012"
msgid "User ID"
msgstr "ID del Usuario"

msgctxt "#40013"
msgid "Search"
msgstr "Buscar"

msgctxt "#40014"
msgid "Catalog"
msgstr "Catálogo"

msgctxt "#40015"
msgid "Purchaseds"
msgstr "Comprado"

msgctxt "#40016"
msgid "Highlighteds"
msgstr "Destacado"

msgctxt "#40017"
msgid "Collections"
msgstr "Colecciones"

msgctxt "#40018"
msgid "Watching"
msgstr "Continuar viendo"

msgctxt "#40019"
msgid "My playlists"
msgstr "Mis listas de reproducción"

msgctxt "#40020"
msgid "Type your username/email"
msgstr "Escribe tu nombre de usuario / correo electrónico"

msgctxt "#40021"
msgid "Type your password"
msgstr "Escribe tu contraseña"
3 changes: 3 additions & 0 deletions resources/lib/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
class Config:
addon = Addon('plugin.video.filmin')

def getLocalizedString(self, l_id: int)-> str:
return self.addon.getLocalizedString(l_id)

# Check if user has already has an access token
def hasLoginData(self)-> bool:
if self.addon.getSettingString('access_token'):
Expand Down
6 changes: 2 additions & 4 deletions resources/lib/player/Player.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

class Player(xbmc.Player):
"""
TODO, MAKE CUSTOM PLAYER WORK
Custom player for Filmin
KODI TIMES ARE IN SECONDS
Expand All @@ -17,7 +16,6 @@ class Player(xbmc.Player):

def __init__(self, can_sync: bool, user_id: int, media_id: int, version_id: int, media_viewing_id: int, session_id: str):
xbmc.Player.__init__(self)
xbmc.log('STARTING CUSTOM PLAYER', xbmc.LOGINFO)
self.can_sync = can_sync
if self.can_sync:
xbmc.log('Enabling sync to FILMIN', xbmc.LOGINFO)
Expand All @@ -27,7 +25,7 @@ def sync(self):
if self.can_sync:
time = self.getTime()
time_ms = time * 1000
xbmc.log(f'Syncing to Filmin at {time} seconds', xbmc.LOGINFO)
xbmc.log(f'Syncing to Filmin at {time} seconds', xbmc.LOGDEBUG)
self.mediamark.sync(time_ms)

def onAVStarted(self):
Expand All @@ -39,7 +37,7 @@ def onAVStarted(self):
kodi_position = self.getTime() # Kodi last position, already in seconds
# Move video to Filmin position
seek_to = filmin_position - kodi_position
xbmc.log(f'Moving video to {seek_to} seconds relative', xbmc.LOGINFO)
xbmc.log(f'Moving video to {seek_to} seconds relative', xbmc.LOGDEBUG)
self.seekTime(seek_to) # seekTime is relative to the current Kodi position

def onPlayBackSeek(self, time: int, seekOffset: int):
Expand Down
6 changes: 3 additions & 3 deletions resources/lib/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
from .common import api, config

def askLogin():
username = Dialog().input('Type your Filmin username/email')
password = Dialog().input('Type your Filmin password')
username = Dialog().input(config.getLocalizedString(40020))
password = Dialog().input(config.getLocalizedString(40021))
if username and password:
res = api.login(username, password)
api.setToken(res['access_token'])
user = api.user()
config.setAuth(res['access_token'], res['refresh_token'], username, user['id'])
Dialog().ok('Login', 'Logged in successfully')
Dialog().ok('Login', config.getLocalizedString(40022))

def startLogout():
api.logout()
Expand Down
21 changes: 11 additions & 10 deletions resources/lib/views/MainMenu.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from .Base import Base
from ..common import config

class MainMenu(Base):
"""
Expand All @@ -8,30 +9,30 @@ class MainMenu(Base):
items = [
{
"id": "search",
"title": "Search"
"title": config.getLocalizedString(40013)
},
{
"id": "watching",
"title": config.getLocalizedString(40018)
},
{
"id": "catalog",
"title": "Catalog"
"title": config.getLocalizedString(40014)
},
{
"id": "purchased",
"title": "Purchased"
"title": config.getLocalizedString(40015)
},
{
"id": "highlighteds",
"title": "Highlighteds"
"title": config.getLocalizedString(40016)
},
{
"id": "collections",
"title": "Collections"
},
{
"id": "watching",
"title": "Watching"
"title": config.getLocalizedString(40017)
},
{
"id": "playlists",
"title": "My playlists"
"title": config.getLocalizedString(40019)
}
]

0 comments on commit 67f7679

Please sign in to comment.