Skip to content

Commit abc2cbb

Browse files
authored
merge release/1.2.0 into master
merge release/1.2.0 into master Merge pull request #19 from chrisism/release/1.2.0
2 parents 3b8e862 + 65be767 commit abc2cbb

20 files changed

Lines changed: 395 additions & 204 deletions

.build/main.yml

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,13 @@ stages:
7575
artifactFeeds: AKL/akl_libs
7676

7777
- bash: |
78+
python -m venv .venv
79+
source .venv/bin/activate
7880
python -m pip install --upgrade pip
81+
pip install setup
7982
pip install -r requirements.txt
80-
displayName: pip install
83+
workingDirectory: $(workingDirectory)
84+
displayName: 'Install application dependencies'
8185
8286
- task: RegExMatchReplace@2
8387
displayName: 'Set addon version'
@@ -86,14 +90,24 @@ stages:
8690
RegEx: 'version="\d+\.\d+\.\d+.*" provider'
8791
ValueToReplace: 'version="$(addonVersion)" provider'
8892

89-
- bash: update_addon_news $(workingDirectory)/addon.xml $(workingDirectory)/changelog.md
93+
- bash: |
94+
source .venv/bin/activate
95+
update_addon_news $(workingDirectory)/addon.xml $(workingDirectory)/changelog.md
9096
displayName: 'Add changelog in addon.xml'
9197
workingDirectory: '$(workingDirectory)'
9298
93-
- bash: 'python -m pytest --junitxml=$(build.artifactstagingdirectory)/$(addonName)_$(addonVersion)_testresults.xml'
99+
# - script: |
100+
# source .venv/bin/activate
101+
# python -m flake8 .
102+
# workingDirectory: '$(workingDirectory)'
103+
# displayName: 'Run lint tests'
104+
105+
- bash: |
106+
source .venv/bin/activate
107+
python -m pytest --junitxml=$(build.artifactstagingdirectory)/$(addonName)_$(addonVersion)_testresults.xml
94108
workingDirectory: '$(workingDirectory)'
95-
displayName: 'Run tests'
96-
109+
displayName: 'Run unit tests'
110+
97111
- task: CopyFiles@2
98112
displayName: 'Copy addon files for package'
99113
inputs:
@@ -112,6 +126,12 @@ stages:
112126
flattenFolders: false
113127
OverWrite: true
114128

129+
- bash: |
130+
source .venv/bin/activate
131+
kodi-addon-checker --branch matrix $(build.artifactstagingdirectory)/$(addonName)/
132+
workingDirectory: '$(workingDirectory)'
133+
displayName: 'Run Kodi addon checker'
134+
115135
- task: ArchiveFiles@2
116136
inputs:
117137
rootFolderOrFile: '$(build.artifactstagingdirectory)/$(addonName)'

.flake8

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[flake8]
2+
max-line-length = 140
3+
exclude =
4+
.git,
5+
tests/*,
6+
__pycache__,
7+
.build,
8+
.vscode,
9+
.venv
10+
ignore = W293

addon.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# -*- coding: utf-8 -*-
1+
# -*- coding: utf-8 -*-
22
#
33
# Advanced Kodi Launcher main script file
44
#
@@ -18,6 +18,7 @@
1818

1919
# Advanced Emulator Launcher main script file.
2020

21+
# --- Python standard library ---
2122
import sys
2223
import logging
2324

@@ -28,13 +29,10 @@
2829
kodilogging.config()
2930
logger = logging.getLogger(__name__)
3031

31-
# --- Python standard library ---
32-
import sys
3332

3433
# -------------------------------------------------------------------------------------------------
3534
# Entrypoint of the Frontend/UI application
3635
# -------------------------------------------------------------------------------------------------
37-
3836
try:
3937
views.run_plugin(sys.argv)
4038
except Exception as ex:

addon.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<requires>
44
<import addon="xbmc.python" version="3.0.0"/>
55
<import addon="script.module.routing" version="0.2.3"/>
6-
<import addon="script.module.akl" version="1.0.7"/>
6+
<import addon="script.module.akl" version="1.0.9"/>
77
</requires>
88
<extension point="xbmc.python.pluginsource" library="addon.py">
99
<provides>executable game</provides>
@@ -15,7 +15,7 @@
1515
<platform>android freebsd ios linux osx windows</platform>
1616
<license>GNU General Public License version 2</license>
1717
<email>crizzz@gmail.com</email>
18-
<forum>http://forum.kodi.tv/showthread.php?tid=366351</forum>
18+
<forum>https://forum.kodi.tv/showthread.php?tid=366351</forum>
1919
<website>https://github.com/chrisism/plugin.program.akl</website>
2020
<source>https://github.com/chrisism/plugin.program.akl</source>
2121
<assets>

changelog.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
## Current
2+
- Added support for PEGI rating
3+
- Fixed bug deleting collections
4+
- Proper icon/thumb mapping for virtual collections
5+
6+
## Previous
27
- Virtual categories now render items from database
38
- Add and execute single instance ROMs or Games
49
- Added an overview option with installed plugins
510
- Fix adding tags to ROMs
611
- Minor bugfixes
712
- Updated dependency
8-
9-
## Bugfixes
1013
- Fixed virtual collections (Favs, Most recent ..)
11-
- Fixed scraping ROM assets only
12-
13-
## Previous: v1.0.0
14-
- The initial release of the new AKL fork.
14+
- Fixed scraping ROM assets only

media/fanart.jpg

461 Bytes
Loading
65.5 KB
Loading
170 KB
Loading

requirements.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@ kodi-addon-checker==0.0.26
33
Kodistubs==19.0.3
44
routing==0.2.3
55
pytest==6.2.5
6-
script.module.akl==1.0.7
7-
requests==2.22.0
6+
script.module.akl==1.0.9
7+
requests==2.22.0
8+
flake8==5.0.4

resources/lib/commands/rom_commands.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ def cmd_rom_metadata(args):
9696
options['ROM_EDIT_METADATA_NPLAYERS'] = "Edit NPlayers: '{}'".format(rom.get_number_of_players())
9797
options['ROM_EDIT_METADATA_NPLAYERS_ONL']= "Edit NPlayers online: '{}'".format(rom.get_number_of_players_online())
9898
options['ROM_EDIT_METADATA_ESRB'] = "Edit ESRB rating: '{}'".format(rom.get_esrb_rating())
99+
options['ROM_EDIT_METADATA_PEGI'] = "Edit PEGI rating: '{}'".format(rom.get_pegi_rating())
99100
options['ROM_EDIT_METADATA_RATING'] = "Edit Rating: '{}'".format(rating)
100101
options['ROM_EDIT_METADATA_PLOT'] = "Edit Plot: '{}'".format(plot_str)
101102
options['ROM_EDIT_METADATA_TAGS'] = "Edit Tags"
@@ -215,7 +216,7 @@ def cmd_rom_metadata_title(args):
215216
AppMediator.sync_cmd('ROM_EDIT_METADATA', args)
216217

217218
@AppMediator.register('ROM_EDIT_METADATA_ESRB')
218-
def cmd_rom_metadata_platform(args):
219+
def cmd_rom_metadata_esrb(args):
219220
rom_id = args['rom_id'] if 'rom_id' in args else None
220221
uow = UnitOfWork(globals.g_PATHS.DATABASE_FILE_PATH)
221222
with uow:
@@ -230,6 +231,23 @@ def cmd_rom_metadata_platform(args):
230231
AppMediator.async_cmd('RENDER_VCATEGORY_VIEW', {'vcategory_id': constants.VCATEGORY_ESRB_ID})
231232

232233
AppMediator.sync_cmd('ROM_EDIT_METADATA', args)
234+
235+
@AppMediator.register('ROM_EDIT_METADATA_PEGI')
236+
def cmd_rom_metadata_pegi(args):
237+
rom_id = args['rom_id'] if 'rom_id' in args else None
238+
uow = UnitOfWork(globals.g_PATHS.DATABASE_FILE_PATH)
239+
with uow:
240+
repository = ROMsRepository(uow)
241+
rom = repository.find_rom(rom_id)
242+
243+
if editors.edit_field_by_list(rom, 'PEGI rating', constants.PEGI_LIST,
244+
rom.get_pegi_rating, rom.set_pegi_rating):
245+
repository.update_rom(rom)
246+
uow.commit()
247+
AppMediator.async_cmd('RENDER_ROM_VIEWS', {'rom_id': rom.get_id()})
248+
AppMediator.async_cmd('RENDER_VCATEGORY_VIEW', {'vcategory_id': constants.VCATEGORY_PEGI_ID})
249+
250+
AppMediator.sync_cmd('ROM_EDIT_METADATA', args)
233251

234252
@AppMediator.register('ROM_EDIT_METADATA_RELEASEYEAR')
235253
def cmd_rom_metadata_releaseyear(args):

0 commit comments

Comments
 (0)