Skip to content

Commit

Permalink
Merge release/1.5.0 into master
Browse files Browse the repository at this point in the history
Merge release/1.5.0 into master
Merge pull request #36 from chrisism/release/1.5.0
  • Loading branch information
chrisism authored May 3, 2024
2 parents 7e2a463 + 019b79a commit 11aaa25
Show file tree
Hide file tree
Showing 45 changed files with 1,359 additions and 531 deletions.
1 change: 1 addition & 0 deletions .build/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ stages:
kodi-addon-checker --branch matrix $(build.artifactstagingdirectory)/$(addonName)/
workingDirectory: '$(workingDirectory)'
displayName: 'Run Kodi addon checker'
continueOnError: true
- task: CopyFiles@2
displayName: 'Copy addon files for repository'
Expand Down
2 changes: 2 additions & 0 deletions SKINNING.md
Original file line number Diff line number Diff line change
Expand Up @@ -299,3 +299,5 @@ Artwork directory ADDON_DATA_DIR/asset-launchers/

* User will have to reorganise artwork directories to take full advantage of AEL
capabilities after importing AL `launchers.xml`.

Font used: Agency FB
2 changes: 1 addition & 1 deletion addon.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<requires>
<import addon="xbmc.python" version="3.0.0"/>
<import addon="script.module.routing" version="0.2.3"/>
<import addon="script.module.akl" version="1.1.0~rc0"/>
<import addon="script.module.akl" version="1.1.0"/>
</requires>
<extension point="xbmc.python.pluginsource" library="addon.py">
<provides>executable game</provides>
Expand Down
2 changes: 2 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
## Current
- Simplified context menu
- Separated launchers
- Implemented sources
- Collections now use import rules from sources
- Added extra field to metadata item
- Search term mode applicable for multi ROM scraping
- Refactoring of default asset mapping
Expand Down
Binary file added media/theme/Launchers_icon.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 media/theme/Launchers_poster.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 removed media/theme/Libraries_icon.png
Binary file not shown.
Binary file removed media/theme/Libraries_poster.png
Binary file not shown.
Binary file removed media/theme/Showcase_Browse_by_icons.jpg
Binary file not shown.
Binary file removed media/theme/Showcase_Browse_by_posters.jpg
Binary file not shown.
Binary file removed media/theme/Showcase_VLauncher_icons.jpg
Binary file not shown.
Binary file removed media/theme/Showcase_VLauncher_posters.jpg
Binary file not shown.
Binary file added media/theme/Sources_icon.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 media/theme/Sources_poster.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
kodi.tools==1.1.0
kodi-addon-checker==0.0.26
Kodistubs==19.0.3
kodi-addon-checker==0.0.31
Kodistubs==21.0.0
routing==0.2.3
pytest==6.2.5
script.module.akl==1.1.0-rc0
script.module.akl==1.1.0
requests==2.22.0
flake8==5.0.4
78 changes: 66 additions & 12 deletions resources/language/resource.language.en_gb/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,10 @@ msgctxt "#42513"
msgid "Collections"
msgstr "domain"

msgctxt "#42514"
msgid "Launcher"
msgstr "domain"

############################
# Advanced Enum values
############################
Expand Down Expand Up @@ -699,15 +703,16 @@ msgid "Edit Category"
msgstr ""

msgctxt "#40888"
msgid "Add new Category"
msgid "Add"
msgstr ""

msgctxt "#40889"
msgid "Add new ROM Collection"
msgstr ""
# TODO: obsolete
# msgctxt "#40889"
# msgid "Add new ROM Collection"
# msgstr ""

msgctxt "#40890"
msgid "Standalone ROM"
msgid "Standalone ROM / application"
msgstr ""

msgctxt "#40891"
Expand Down Expand Up @@ -834,6 +839,14 @@ msgctxt "#40921"
msgid "Add new ruleset"
msgstr ""

msgctxt "#40922"
msgid "Import ROMs by rulesets"
msgstr ""

msgctxt "#40923"
msgid "Render views"
msgstr ""

############################
# Headers and texts / notifications / dialogs
############################
Expand All @@ -845,9 +858,10 @@ msgctxt "#40951"
msgid "Invalid parameters supplied."
msgstr ""

msgctxt "#40952"
msgid "File is directly executable/launchable"
msgstr ""
# TODO: Obsolete
# msgctxt "#40952"
# msgid "File is directly executable/launchable"
# msgstr ""

msgctxt "#40953"
msgid "Select file to execute (Skip if not available)"
Expand Down Expand Up @@ -1634,7 +1648,7 @@ msgid "No NFO file available"
msgstr ""

msgctxt "#41149"
msgid "Assets directories not set: {0}.\nAsset scanner will be disabled for this/those."
msgid "Source assets directories not set: {0}.\nAsset scanner will be disabled for this/those."
msgstr ""

msgctxt "#41150"
Expand Down Expand Up @@ -1770,7 +1784,7 @@ msgid "Choose action for rule"
msgstr ""

msgctxt "#41183"
msgid "ROMs imported"
msgid "{0} ROMs imported"
msgstr ""

msgctxt "#41184"
Expand All @@ -1797,6 +1811,38 @@ msgctxt "#41189"
msgid "Currently importing: {0}"
msgstr ""

msgctxt "#41190"
msgid "Importing ROMs for collection {0} from source {1}"
msgstr ""

msgctxt "#41191"
msgid "No rulesets associated.\nGo to Edit and Manage ROMs to create rulesets."
msgstr ""

msgctxt "#41192"
msgid "What to add?"
msgstr ""

msgctxt "#41193"
msgid "Remove ruleset"
msgstr ""

msgctxt "#41194"
msgid "This action will remove this ruleset.\nAre you sure to continue?"
msgstr ""

msgctxt "#41195"
msgid "Ruleset removed"
msgstr ""

msgctxt "#41196"
msgid "Removed ROM {0} from {1}"
msgstr ""

msgctxt "#41197"
msgid "From which ROM collection"
msgstr ""

############################
# List/Action options
############################
Expand Down Expand Up @@ -1958,7 +2004,7 @@ msgid "Manage ROMs ..."
msgstr ""

msgctxt "#42040"
msgid "Change Category: '{}'"
msgid "Change parent Category: '{}'"
msgstr ""

msgctxt "#42041"
Expand Down Expand Up @@ -2106,7 +2152,7 @@ msgid "Edit source scanner"
msgstr ""

msgctxt "#42082"
msgid "Import ROMs"
msgid "Import ROMs Rules"
msgstr ""

msgctxt "#42083"
Expand Down Expand Up @@ -2141,6 +2187,14 @@ msgctxt "#42090"
msgid "Create new launcher..."
msgstr ""

msgctxt "#42091"
msgid "ROM '{}' status is now {}"
msgstr ""

msgctxt "#42092"
msgid "Remove ROM from collection"
msgstr ""

############################
# Context menu item descriptions
############################
Expand Down
35 changes: 30 additions & 5 deletions resources/lib/apiqueries.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
def qry_get_rom(rom_id: str) -> str:
uow = UnitOfWork(globals.g_PATHS.DATABASE_FILE_PATH)
with uow:
rom_repository = ROMsRepository(uow)
rom_repository = ROMsRepository(uow)
rom = rom_repository.find_rom(rom_id)

if rom is None:
Expand All @@ -45,7 +45,7 @@ def qry_get_rom(rom_id: str) -> str:
def qry_get_rom_collection(collection_id: str) -> str:
uow = UnitOfWork(globals.g_PATHS.DATABASE_FILE_PATH)
with uow:
collection_repository = ROMCollectionRepository(uow)
collection_repository = ROMCollectionRepository(uow)
rom_collection = collection_repository.find_romcollection(collection_id)

if rom_collection is None:
Expand All @@ -72,7 +72,27 @@ def qry_get_roms(source_id: str) -> str:
rom_dto = rom.create_dto()
data.append(rom_dto.get_data_dic())

return json.dumps(data)
return json.dumps(data)


def qry_get_roms_by_romcollection(collection_id: str) -> str:
uow = UnitOfWork(globals.g_PATHS.DATABASE_FILE_PATH)
with uow:
collection_repository = ROMCollectionRepository(uow)
rom_repository = ROMsRepository(uow)

collection = collection_repository.find_romcollection(collection_id)
roms = rom_repository.find_roms_by_romcollection(collection)

if roms is None:
return None

data = []
for rom in roms:
rom_dto = rom.create_dto()
data.append(rom_dto.get_data_dic())

return json.dumps(data)


def qry_get_launcher_settings(launcher_id: str) -> str:
Expand All @@ -82,7 +102,9 @@ def qry_get_launcher_settings(launcher_id: str) -> str:
launcher = repository.find(launcher_id)

if launcher is not None:
return launcher.get_settings_str()
settings = launcher.get_settings()
settings['name'] = launcher.get_name()
return json.dumps(settings)

return None

Expand All @@ -97,7 +119,9 @@ def qry_get_collection_launcher_settings(collection_id: str, launcher_id: str) -
return None

launcher = rom_collection.get_launcher(launcher_id)
return launcher.get_settings_str()
settings = launcher.get_settings()
settings['name'] = launcher.get_name()
return json.dumps(settings)


def qry_get_source_scanner_settings(source_id: str) -> str:
Expand Down Expand Up @@ -125,5 +149,6 @@ def qry_get_source_launchers(source_id: str) -> str:
launchers = source.get_launchers()
for launcher in launchers:
launchers_data[launcher.get_id()] = launcher.get_settings()
launchers_data[launcher.get_id()]['name'] = launcher.get_name()

return json.dumps(launchers_data)
32 changes: 16 additions & 16 deletions resources/lib/commands/addon_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@

from resources.lib.commands.mediator import AppMediator
from resources.lib import globals
from resources.lib.repositories import UnitOfWork, AelAddonRepository
from resources.lib.domain import AelAddon, g_assetFactory
from resources.lib.repositories import UnitOfWork, AklAddonRepository
from resources.lib.domain import AklAddon, g_assetFactory

logger = logging.getLogger(__name__)

Expand All @@ -56,7 +56,7 @@ def cmd_scan_addons(args):
def cmd_show_addons(args):
uow = UnitOfWork(globals.g_PATHS.DATABASE_FILE_PATH)
with uow:
repository = AelAddonRepository(uow)
repository = AklAddonRepository(uow)
addons = repository.find_all()

options = collections.OrderedDict()
Expand Down Expand Up @@ -111,7 +111,7 @@ def cmd_addon_details(args):

uow = UnitOfWork(globals.g_PATHS.DATABASE_FILE_PATH)
with uow:
repository = AelAddonRepository(uow)
repository = AklAddonRepository(uow)

if constants.AddonType.LAUNCHER.name in addon_types:
ael_addon = repository.find_by_addon_id(addon_id, constants.AddonType.LAUNCHER)
Expand Down Expand Up @@ -144,15 +144,15 @@ def cmd_addon_details(args):

if selected_option == "METADATA":
supported_metadata_str = addon.getSetting('akl.scraper.supported_metadata')
options = { m: kodi.translate(constants.METADATA_DESCRIPTIONS[m]) for m in supported_metadata_str.split('|') }
options = {m: kodi.translate(constants.METADATA_DESCRIPTIONS[m]) for m in supported_metadata_str.split('|')}
kodi.OrdDictionaryDialog().select(kodi.translate(41082).format(addon.getAddonInfo('name')), options)
cmd_addon_details(args)
return

if selected_option == "ASSETS":
supported_assets_str = addon.getSetting('akl.scraper.supported_assets')
assets = g_assetFactory.get_asset_list_by_IDs(supported_assets_str.split('|'))
options = { a.id: a.name for a in assets }
options = {a.id: a.name for a in assets}
kodi.OrdDictionaryDialog().select(kodi.translate(41083).format(addon.getAddonInfo('name')), options)
cmd_addon_details(args)
return
Expand All @@ -172,7 +172,7 @@ def _check_installed_addons() -> int:

uow = UnitOfWork(globals.g_PATHS.DATABASE_FILE_PATH)
with uow:
addon_repository = AelAddonRepository(uow)
addon_repository = AklAddonRepository(uow)
existing_addons = [*addon_repository.find_all()]

existing_launcher_ids = {a.get_addon_id(): a for a in existing_addons if a.get_addon_type() == constants.AddonType.LAUNCHER}
Expand Down Expand Up @@ -206,12 +206,12 @@ def _check_installed_addons() -> int:
def _process_launcher_addon(
addon_id: str,
addon: xbmcaddon.Addon,
existing_addon_ids: typing.Dict[str, AelAddon],
addon_repository: AelAddonRepository):
existing_addon_ids: typing.Dict[str, AklAddon],
addon_repository: AklAddonRepository):
addon_name = addon.getSetting('akl.launcher.friendlyname')
addon_name = addon.getAddonInfo('name') if addon_name is None or addon_name == '' else addon_name

addon_obj = AelAddon({
addon_obj = AklAddon({
'addon_id': addon_id,
'version': addon.getAddonInfo('version'),
'name': addon_name,
Expand All @@ -232,12 +232,12 @@ def _process_launcher_addon(
def _process_scanner_addon(
addon_id: str,
addon: xbmcaddon.Addon,
existing_addon_ids: typing.Dict[str, AelAddon],
addon_repository: AelAddonRepository):
existing_addon_ids: typing.Dict[str, AklAddon],
addon_repository: AklAddonRepository):
addon_name = addon.getSetting('akl.scanner.friendlyname')
addon_name = addon.getAddonInfo('name') if addon_name is None or addon_name == '' else addon_name

addon_obj = AelAddon({
addon_obj = AklAddon({
'addon_id': addon_id,
'version': addon.getAddonInfo('version'),
'name': addon_name,
Expand All @@ -258,12 +258,12 @@ def _process_scanner_addon(
def _process_scraper_addon(
addon_id: str,
addon: xbmcaddon.Addon,
existing_addon_ids: typing.Dict[str, AelAddon],
addon_repository: AelAddonRepository):
existing_addon_ids: typing.Dict[str, AklAddon],
addon_repository: AklAddonRepository):
addon_name = addon.getSetting('akl.scraper.friendlyname')
addon_name = addon.getAddonInfo('name') if addon_name is None or addon_name == '' else addon_name

addon_obj = AelAddon({
addon_obj = AklAddon({
'addon_id': addon_id,
'version': addon.getAddonInfo('version'),
'name': addon_name,
Expand Down
Loading

0 comments on commit 11aaa25

Please sign in to comment.