Skip to content

Commit

Permalink
Merge release/1.3.0 into master
Browse files Browse the repository at this point in the history
Merge pull request #24 from chrisism/release/1.3.0
* fix build yml
* Added packaging package
* Set packaging version
* Feature/overwrite metadata param (#21)
* Applied overwrite metadata option
* Overwrite meta action implemented
* package fix
* Moved moment of addon check in yml
* Fixing delete category (#22)
* Feature/view UI (#23)
* Adding new view rom skin
* Better looks and feels
* Implemented actions on view screen
* Updated changelog
* Query fix
* Debug logging for overwrite
* Removed logging
* Added auto view
* Adding scanned data to view
* Updated dependencies
  • Loading branch information
chrisism authored Jan 23, 2023
2 parents fb6d156 + 403cda5 commit 05b9d83
Show file tree
Hide file tree
Showing 48 changed files with 1,370 additions and 168 deletions.
14 changes: 7 additions & 7 deletions .build/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ stages:
python -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
pip install setup
pip install packaging==21.3
pip install -r requirements.txt
workingDirectory: $(workingDirectory)
displayName: 'Install application dependencies'
Expand Down Expand Up @@ -126,12 +126,6 @@ stages:
flattenFolders: false
OverWrite: true

- bash: |
source .venv/bin/activate
kodi-addon-checker --branch matrix $(build.artifactstagingdirectory)/$(addonName)/
workingDirectory: '$(workingDirectory)'
displayName: 'Run Kodi addon checker'
- task: ArchiveFiles@2
inputs:
rootFolderOrFile: '$(build.artifactstagingdirectory)/$(addonName)'
Expand All @@ -140,6 +134,12 @@ stages:
archiveFile: '$(build.artifactstagingdirectory)/package/$(addonName)-$(addonVersion).zip'
replaceExistingArchive: true

- bash: |
source .venv/bin/activate
kodi-addon-checker --branch matrix $(build.artifactstagingdirectory)/$(addonName)/
workingDirectory: '$(workingDirectory)'
displayName: 'Run Kodi addon checker'
- task: CopyFiles@2
displayName: 'Copy addon files for repository'
inputs:
Expand Down
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.0.9"/>
<import addon="script.module.akl" version="1.0.11"/>
</requires>
<extension point="xbmc.python.pluginsource" library="addon.py">
<provides>executable game</provides>
Expand Down
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
## Current
- Custom skin view for View ROM
- More details about addon plugins

## Previous
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ kodi-addon-checker==0.0.26
Kodistubs==19.0.3
routing==0.2.3
pytest==6.2.5
script.module.akl==1.0.9
script.module.akl==1.0.11
requests==2.22.0
flake8==5.0.4
84 changes: 84 additions & 0 deletions resources/language/resource.language.en_gb/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ msgctxt "#40415"
msgid "Hide Global Reports"
msgstr "settings.xml"

msgctxt "#40416"
msgid "Launch ROM directly by default on item action"
msgstr "settings.xml"

############################
# Setting options - Paths
############################
Expand Down Expand Up @@ -208,6 +212,86 @@ msgctxt "#40702"
msgid "Google scraper plugin"
msgstr "settings.xml"

############################
# Metadata labels
############################

msgctxt "#40801"
msgid "Genre"
msgstr ""

msgctxt "#40802"
msgid "Developer"
msgstr ""

msgctxt "#40803"
msgid "Year released"
msgstr ""

msgctxt "#40804"
msgid "ESRB Rating"
msgstr ""

msgctxt "#40805"
msgid "PEGI Rating"
msgstr ""

msgctxt "#40806"
msgid "Rating"
msgstr ""

msgctxt "#40807"
msgid "Platform"
msgstr ""

msgctxt "#40808"
msgid "Number of players"
msgstr ""

msgctxt "#40809"
msgid "Number of players online"
msgstr ""

msgctxt "#40810"
msgid "Tags"
msgstr ""

msgctxt "#40811"
msgid "Plot"
msgstr ""

msgctxt "#40812"
msgid "Title"
msgstr ""

msgctxt "#40813"
msgid "Identifier"
msgstr ""

############################
# Actions
############################

msgctxt "#40851"
msgid "Launch"
msgstr ""

msgctxt "#40852"
msgid "Play trailer"
msgstr ""

msgctxt "#40853"
msgid "Edit Metadata"
msgstr ""

msgctxt "#40854"
msgid "Edit Assets/Artwork"
msgstr ""

msgctxt "#40855"
msgid "Scrape ROM"
msgstr ""

############################
# Scraping settings
############################
Expand Down
12 changes: 8 additions & 4 deletions resources/lib/commands/api_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def cmd_store_scanned_roms(args) -> bool:
api_rom_obj = ROMObj(rom_data)

rom_obj = ROM()
rom_obj.update_with(api_rom_obj, overwrite_existing=True, update_scanned_data=True)
rom_obj.update_with(api_rom_obj, overwrite_existing_metadata=True, update_scanned_data=True)
rom_obj.set_platform(romcollection.get_platform())
rom_obj.scanned_with(scanner_id)
rom_obj.apply_romcollection_asset_paths(romcollection)
Expand Down Expand Up @@ -208,7 +208,9 @@ def cmd_store_scraped_roms(args) -> bool:
logger.debug('========================== Applied scraper settings ==========================')
logger.debug('Metadata IDs: {}'.format(', '.join(applied_settings.metadata_IDs_to_scrape)))
logger.debug('Asset IDs: {}'.format(', '.join(applied_settings.asset_IDs_to_scrape)))
logger.debug('Overwrite existing: {}'.format('Yes' if applied_settings.overwrite_existing else 'No'))
logger.debug('Overwrite existing:')
logger.debug(' - Metadata {}'.format('Yes' if applied_settings.overwrite_existing_meta else 'No'))
logger.debug(' - Assets {}'.format('Yes' if applied_settings.overwrite_existing_assets else 'No'))

for rom_data in scraped_roms:
api_rom_obj = ROMObj(rom_data)
Expand All @@ -226,7 +228,8 @@ def cmd_store_scraped_roms(args) -> bool:
api_rom_obj,
metadata_to_update,
assets_to_update,
overwrite_existing=applied_settings.overwrite_existing)
overwrite_existing_metadata=applied_settings.overwrite_existing_meta,
overwrite_existing_assets=applied_settings.overwrite_existing_assets)
#rom_obj.scraped_with(scraper_id)

rom_repository.update_rom(rom_obj)
Expand Down Expand Up @@ -277,7 +280,8 @@ def cmd_store_scraped_single_rom(args) -> bool:
rom.update_with(scraped_rom,
metadata_to_update,
assets_to_update,
overwrite_existing=applied_settings.overwrite_existing)
overwrite_existing_metadata=applied_settings.overwrite_existing_meta,
overwrite_existing_assets=applied_settings.overwrite_existing_assets)
#rom_obj.scraped_with(scraper_id)

rom_repository.update_rom(rom)
Expand Down
14 changes: 7 additions & 7 deletions resources/lib/commands/category_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,21 +224,21 @@ def cmd_category_delete(args):
category_name = category.get_name()

if category.has_items():
question = 'Category "{}" has {} sub-categories and {} romcollections. '.format(category_name, category.num_categories(), category.num_romcollections()) + \
'Deleting it will also delete related items. ' + \
'Are you sure you want to delete "{}"?'.format(category_name)
question = (f'Category "{category_name}" has {category.num_categories()} sub-categories and '
f'{category.num_romcollections()} romcollections. Deleting it will also delete related items. '
f'Are you sure you want to delete "{category_name}"?')
else:
question = 'Category "{}" has no categories or romcollections. '.format(category_name) + \
'Are you sure you want to delete "{}"?'.format(category_name)
question = (f'Category "{category_name}" has no categories or romcollections. '
f'Are you sure you want to delete "{category_name}"?')

ret = kodi.dialog_yesno(question)
if not ret: return

logger.info('Deleting category "{}" ID {}'.format(category_name, category.get_id()))
logger.info(f'Deleting category "{category_name}" ID {category.get_id()}')
repository.delete_category(category_id)
uow.commit()

kodi.notify('Deleted category {0}'.format(category_name))
kodi.notify(f'Deleted category {category_name}')
AppMediator.async_cmd('RENDER_CATEGORY_VIEW', {'category_id': category.get_parent_id()})
AppMediator.async_cmd('CLEANUP_VIEWS')
AppMediator.sync_cmd('EDIT_CATEGORY', args)
Expand Down
6 changes: 3 additions & 3 deletions resources/lib/commands/rom_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ def cmd_edit_rom(args):
rom = repository.find_rom(rom_id)

options = collections.OrderedDict()
options['ROM_EDIT_METADATA'] = 'Edit Metadata ...'
options['ROM_EDIT_ASSETS'] = 'Edit Assets/Artwork ...'
options['ROM_EDIT_METADATA'] = f'{kodi.translate(40853)} ...'
options['ROM_EDIT_ASSETS'] = f'{kodi.translate(40854)} ...'
options['EDIT_ROM_STATUS'] = f'ROM status: {rom.get_finished_str()}'
if rom.has_launchers():
options['EDIT_ROM_LAUNCHERS'] = 'Manage associated launchers'
else: options['ADD_ROM_LAUNCHER'] = 'Add new launcher to ROM'
options['DELETE_ROM'] = 'Delete ROM'
options['SCRAPE_ROM'] = 'Scrape ROM'
options['SCRAPE_ROM'] = kodi.translate(40855)

s = f'Edit ROM "{rom.get_name()}"'
selected_option = kodi.OrdDictionaryDialog().select(s, options)
Expand Down
Loading

0 comments on commit 05b9d83

Please sign in to comment.