Skip to content

Commit

Permalink
Merge release/1.0.1 into master
Browse files Browse the repository at this point in the history
Merge release/1.0.1 into master
  • Loading branch information
chrisism authored Apr 3, 2022
2 parents ec34a92 + 173d7a0 commit 24fdbaa
Show file tree
Hide file tree
Showing 11 changed files with 91 additions and 108 deletions.
53 changes: 28 additions & 25 deletions .build/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
trigger:
- master
- release/*
- hotfix/*
- dev

pool:
Expand All @@ -31,6 +32,7 @@ variables:
isReleaseCandidate: ${{startsWith(variables['Build.SourceBranch'], 'refs/heads/release/')}}
isHotfix: ${{startsWith(variables['Build.SourceBranch'], 'refs/heads/hotfix/')}}
isDev: ${{eq(variables['Build.SourceBranch'], 'refs/heads/dev')}}
isPR: ${{startsWith(variables['Build.SourceBranch'], 'refs/pull/')}}
workingDirectory: '$(Build.SourcesDirectory)'
addonName: plugin.program.akl

Expand All @@ -40,25 +42,27 @@ stages:
jobs:
- job: build
displayName: build
workspace:
clean: all

steps:
- task: gitversion/setup@0
displayName: 'Install GitTools'
inputs:
versionSpec: '5.3.x'
versionSpec: '5.x'

- task: gitversion/execute@0
displayName: 'Executing gitversion'

- script: |
echo '##vso[task.setvariable variable=packageVersion]$(GitVersion.LegacySemVer)
echo '##vso[task.setvariable variable=projectVersion]$(GitVersion.Major).$(GitVersion.Minor).$(GitVersion.Patch)
echo '##vso[task.setvariable variable=addonVersion]$(GitVersion.Major).$(GitVersion.Minor).$(GitVersion.Patch)~$(GitVersion.PreReleaseLabel)$(GitVersion.PreReleaseNumber)
echo '##vso[task.setvariable variable=tagVersion]$(GitVersion.LegacySemVer)
displayName: 'Setting version variables'
condition: not(eq(${{variables.isMaster}}, true))
- script: |
echo '##vso[task.setvariable variable=packageVersion]$(GitVersion.Major).$(GitVersion.Minor).$(GitVersion.Patch)
echo '##vso[task.setvariable variable=projectVersion]$(GitVersion.Major).$(GitVersion.Minor).$(GitVersion.Patch)
echo '##vso[task.setvariable variable=addonVersion]$(GitVersion.Major).$(GitVersion.Minor).$(GitVersion.Patch)
echo '##vso[task.setvariable variable=tagVersion]$(GitVersion.Major).$(GitVersion.Minor).$(GitVersion.Patch)
displayName: 'Setting version variables'
condition: eq(${{variables.isMaster}}, true)
Expand All @@ -69,7 +73,7 @@ stages:
displayName: Authenticate with artifact feed
inputs:
artifactFeeds: AKL/akl_libs

- bash: |
python -m pip install --upgrade pip
pip install -r requirements.txt
Expand All @@ -80,16 +84,16 @@ stages:
inputs:
PathToFile: 'addon.xml'
RegEx: 'version="\d+\.\d+\.\d+.*" provider'
ValueToReplace: 'version="$(packageVersion)" provider'
ValueToReplace: 'version="$(addonVersion)" provider'

- bash: update_addon_news $(workingDirectory)/addon.xml $(workingDirectory)/changelog.txt
- bash: update_addon_news $(workingDirectory)/addon.xml $(workingDirectory)/changelog.md
displayName: 'Add changelog in addon.xml'
workingDirectory: '$(workingDirectory)'

- bash: 'python -m pytest --junitxml=$(build.artifactstagingdirectory)/$(addonName)_$(packageVersion)_testresults.xml'
workingDirectory: '$(workingDirectory)'
- bash: 'python -m pytest --junitxml=$(build.artifactstagingdirectory)/$(addonName)_$(addonVersion)_testresults.xml'
workingDirectory: '$(workingDirectory)'
displayName: 'Run tests'

- task: CopyFiles@2
displayName: 'Copy addon files for package'
inputs:
Expand All @@ -98,7 +102,6 @@ stages:
*.py
*.md
*.xml
*.txt
resources/**/*.*
media/**/*.*
!requirements.txt
Expand All @@ -114,7 +117,7 @@ stages:
rootFolderOrFile: '$(build.artifactstagingdirectory)/$(addonName)'
includeRootFolder: true
archiveType: 'zip'
archiveFile: '$(build.artifactstagingdirectory)/package/$(addonName)-$(packageVersion).zip'
archiveFile: '$(build.artifactstagingdirectory)/package/$(addonName)-$(addonVersion).zip'
replaceExistingArchive: true

- task: CopyFiles@2
Expand All @@ -129,7 +132,7 @@ stages:
flattenFolders: false
OverWrite: true

- script: md5sum $(addonName)-$(packageVersion).zip > $(addonName)-$(packageVersion).zip.md5
- script: md5sum $(addonName)-$(addonVersion).zip > $(addonName)-$(addonVersion).zip.md5
workingDirectory: $(build.artifactstagingdirectory)/package/
displayName: 'Creating md5 file for zipfile'

Expand All @@ -143,32 +146,32 @@ stages:
PathtoPublish: '$(build.artifactstagingdirectory)/package/'
ArtifactName: '$(addonName)'
publishLocation: 'Container'

- task: PublishTestResults@2
displayName: 'Publish test result'
inputs:
testResultsFiles: '$(build.artifactstagingdirectory)/$(addonName)_$(packageVersion)_testresults.xml'
testRunTitle: $(addonName)_$(packageVersion)
testResultsFiles: '$(build.artifactstagingdirectory)/$(addonName)_$(addonVersion)_testresults.xml'
testRunTitle: $(addonName)_$(addonVersion)
condition: succeededOrFailed()

- task: GithubRelease@1
displayName: 'Create GitHub Release'
condition: and(succeeded(), eq(${{variables.isMaster}}, true))
continueOnError: true
inputs:
gitHubConnection: 'github.com_chrisism'
repositoryName: chrisism/$(addonName)
action: 'create'
target: '$(Build.SourceVersion)'
tagSource: 'userSpecifiedTag'
tag: $(packageVersion)
tag: $(tagVersion)
title: $(Build.BuildNumber)
releaseNotesSource: filePath
releaseNotesFilePath: $(workingDirectory)/release.md
releaseNotesFilePath: $(workingDirectory)/changelog.md
addChangeLog: true
assets: |
$(build.artifactstagingdirectory)/package/*.*
$(workingDirectory)/changelog.txt
$(workingDirectory)/README.md
- stage: DeployStaging
displayName: Deployment on Staging
Expand All @@ -186,15 +189,15 @@ stages:
value: repository.chrisism.dev
- name: repository_data_dir
value: 'matrix'
- name: branchName
- name: branch_name
value: main

strategy:
runOnce:
deploy:
steps:
- template: publish_in_repository_steps.yml

- stage: DeployProd
displayName: Deployment on Production
condition: and(succeeded(), eq(${{variables.isMaster}}, true))
Expand All @@ -211,7 +214,7 @@ stages:
value: repository.chrisism
- name: repository_data_dir
value: 'matrix'
- name: branchName
- name: branch_name
value: master

strategy:
Expand Down
23 changes: 13 additions & 10 deletions GitVersion.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
continuous-delivery-fallback-tag: unstable
commit-message-incrementing: enabled
branches:
develop:
regex: dev(elop)?(ment)?$
mode: ContinuousDeployment
tag: unstable
increment: Minor
prevent-increment-of-merged-branch-version: false
track-merge-target: true
master:
regex: (master|main)
mode: ContinuousDeployment
regex: ^master$|^main$
mode: ContinuousDelivery
tag: "stable"
increment: Patch
prevent-increment-of-merged-branch-version: true
track-merge-target: false
source-branches: [ 'develop', 'release', 'hotfix']
tracks-release-branches: false
is-release-branch: false
is-mainline: true
develop:
regex: dev(elop)?(ment)?$
mode: ContinuousDeployment
tag: alpha
increment: Minor
track-merge-target: true
hotfix:
regex: hotfix(es)?[/-]
mode: ContinuousDeployment
tag: useBranchName
tag: rc
increment: Patch
prevent-increment-of-merged-branch-version: false
track-merge-target: true
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Plugins are available for scanning your ROMs from different locations on your di
Basically the possibilities are endless since you can easily extend AKL with your own plugins to add your type of launcher. Now you don't have to build a complete launcher addon, simply implement the plugin and hook it up in AKL. So one launcher addon to support all support them all. Add your own plugin now.

| Release | Status |
|----|----|----|
|----|----|
| Stable | [![Build Status](https://dev.azure.com/jnpro/AKL/_apis/build/status/plugin.program.akl?branchName=master)](https://dev.azure.com/jnpro/AKL/_build/latest?definitionId=5&branchName=master) |
| Beta | [![Build Status](https://dev.azure.com/jnpro/AKL/_apis/build/status/plugin.program.akl?branchName=release/1.0.0)](https://dev.azure.com/jnpro/AKL/_build/latest?definitionId=5&branchName=release/1.0.0) |
| Unstable | [![Build Status](https://dev.azure.com/jnpro/AKL/_apis/build/status/plugin.program.akl?branchName=dev)](https://dev.azure.com/jnpro/AKL/_build/latest?definitionId=5&branchName=dev) |
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.2"/>
<import addon="script.module.akl" version="1.0.5"/>
</requires>
<extension point="xbmc.python.pluginsource" library="addon.py">
<provides>executable game</provides>
Expand Down
7 changes: 6 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
The initial release of the new AKL fork.
## Current
- Minor bugfixes
- Updated dependency

## Previous: v1.0.0
- The initial release of the new AKL fork.
2 changes: 0 additions & 2 deletions changelog.txt

This file was deleted.

1 change: 0 additions & 1 deletion release.md

This file was deleted.

5 changes: 3 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
kodi.tools==1.0.0
kodi.tools==1.1.0
kodi-addon-checker==0.0.26
Kodistubs==19.0.3
routing==0.2.3
pytest==6.2.5
script.module.akl==1.0.2
script.module.akl==1.0.5
requests==2.22.0
17 changes: 16 additions & 1 deletion resources/lib/commands/api_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,11 @@ def cmd_store_scraped_roms(args) -> bool:
metadata_to_update = applied_settings.metadata_IDs_to_scrape if metadata_is_updated else []
assets_to_update = applied_settings.asset_IDs_to_scrape if assets_are_updated else []

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'))

for rom_data in scraped_roms:
api_rom_obj = ROMObj(rom_data)

Expand Down Expand Up @@ -247,8 +252,18 @@ def cmd_store_scraped_single_rom(args) -> bool:

metadata_to_update = applied_settings.metadata_IDs_to_scrape if metadata_is_updated else []
assets_to_update = applied_settings.asset_IDs_to_scrape if assets_are_updated else []

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('Metadata updated: {}'.format('Yes' if metadata_is_updated else 'No'))
logger.debug('Assets updated: {}'.format('Yes' if assets_are_updated else 'No'))

rom.update_with(scraped_rom, metadata_to_update, assets_to_update)
rom.update_with(scraped_rom,
metadata_to_update,
assets_to_update,
overwrite_existing=applied_settings.overwrite_existing)
#rom_obj.scraped_with(scraper_id)

rom_repository.update_rom(rom)
Expand Down
41 changes: 23 additions & 18 deletions resources/lib/domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@

logger = logging.getLogger(__name__)

def is_empty(input: any) -> bool:
return input is None or len(input) == 0

# -------------------------------------------------------------------------------------------------
# Gets all required information about an asset: path, name, etc.
# Returns an object with all the information
Expand Down Expand Up @@ -1523,49 +1526,51 @@ def update_with(self,
assets_to_update=[],
overwrite_existing=False,
update_scanned_data=False):

if constants.META_TITLE_ID in metadata_to_update \
and api_rom_obj.get_name() is not None:
and api_rom_obj.get_name():
self.set_name(api_rom_obj.get_name())

if constants.META_PLOT_ID in metadata_to_update \
and api_rom_obj.get_plot() is not None \
and (overwrite_existing or self.get_plot()):
and api_rom_obj.get_plot() \
and (overwrite_existing or is_empty(self.get_plot())):
self.set_plot(api_rom_obj.get_plot())

logger.debug('Plot3 ' + self.get_plot())

if constants.META_YEAR_ID in metadata_to_update \
and api_rom_obj.get_releaseyear() is not None \
and (overwrite_existing or self.get_releaseyear()):
and api_rom_obj.get_releaseyear() \
and (overwrite_existing or is_empty(self.get_releaseyear())):
self.set_releaseyear(api_rom_obj.get_releaseyear())

if constants.META_GENRE_ID in metadata_to_update \
and api_rom_obj.get_genre() is not None\
and (overwrite_existing or self.get_genre()):
and api_rom_obj.get_genre() \
and (overwrite_existing or is_empty(self.get_genre())):
self.set_genre(api_rom_obj.get_genre())

if constants.META_DEVELOPER_ID in metadata_to_update \
and api_rom_obj.get_developer() is not None\
and (overwrite_existing or self.get_developer()):
and api_rom_obj.get_developer() \
and (overwrite_existing or is_empty(self.get_developer())):
self.set_developer(api_rom_obj.get_developer())

if constants.META_NPLAYERS_ID in metadata_to_update \
and api_rom_obj.get_number_of_players() is not None\
and (overwrite_existing or self.get_number_of_players()):
and api_rom_obj.get_number_of_players() \
and (overwrite_existing or is_empty(self.get_number_of_players())):
self.set_number_of_players(api_rom_obj.get_number_of_players())

if constants.META_NPLAYERS_ONLINE_ID in metadata_to_update \
and api_rom_obj.get_number_of_players_online() is not None\
and (overwrite_existing or self.get_number_of_players_online()):
and api_rom_obj.get_number_of_players_online() \
and (overwrite_existing or is_empty(self.get_number_of_players_online())):
self.set_number_of_players_online(api_rom_obj.get_number_of_players_online())

if constants.META_ESRB_ID in metadata_to_update\
and api_rom_obj.get_esrb_rating() is not None\
and (overwrite_existing or self.get_esrb_rating()):
and api_rom_obj.get_esrb_rating() \
and (overwrite_existing or is_empty(self.get_esrb_rating())):
self.set_esrb_rating(api_rom_obj.get_esrb_rating())

if constants.META_RATING_ID in metadata_to_update \
and api_rom_obj.get_rating() is not None\
and (overwrite_existing or self.get_rating()):
and api_rom_obj.get_rating() \
and (overwrite_existing or is_empty(self.get_rating())):
self.set_rating(api_rom_obj.get_rating())

if constants.META_TAGS_ID in metadata_to_update and api_rom_obj.get_tags() is not None:
Expand Down
Loading

0 comments on commit 24fdbaa

Please sign in to comment.