Skip to content

Commit

Permalink
(tinymediamanager) Update to expected format
Browse files Browse the repository at this point in the history
  • Loading branch information
AdmiringWorm committed Mar 12, 2024
1 parent d6bf3f5 commit 58f79b2
Show file tree
Hide file tree
Showing 7 changed files with 147 additions and 58 deletions.
6 changes: 3 additions & 3 deletions automatic/tinymediamanager/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,23 @@ tinyMediaManager will run on Windows, Linux and macOS (and possible more OS).

### Movie Management

![Movie Management](screenshots/movies.png)
![Movie Management](https://cdn.jsdelivr.net/gh/AdmiringWorm/chocolatey-packages@f7ecb4a5879a829f63b4ad078a918e9595cef15a/automatic/tinymediamanager/screenshots/movies.png)

- Get data from **TheMovieDB.org, Imdb.com, Ofdb.de, HD-Trailers.net**, ...
- Create NFO for use with Kodi (XBMC) and MediaPortal
- Automatically rename files and folders as you like

### Movie Set Management

![Movie Set Management](screenshots/moviesets.png)
![Movie Set Management](https://cdn.jsdelivr.net/gh/AdmiringWorm/chocolatey-packages@f7ecb4a5879a829f63b4ad078a918e9595cef15a/automatic/tinymediamanager/screenshots/moviesets.png)

- Organize movies into collections
- Set artwork for moviesets
- Support NFO tags for moviesets for **Kodi (XBMC)** and **MediaPortal**

### TV Show Management

![TV Show Management](screenshots/tvshows.png)
![TV Show Management](https://cdn.jsdelivr.net/gh/AdmiringWorm/chocolatey-packages@f7ecb4a5879a829f63b4ad078a918e9595cef15a/automatic/tinymediamanager/screenshots/tvshows.png)

- find TV shows and episodes in subdirectories - powerful episode/season
detection
Expand Down
26 changes: 9 additions & 17 deletions automatic/tinymediamanager/legal/VERIFICATION.txt
Original file line number Diff line number Diff line change
@@ -1,26 +1,18 @@
VERIFICATION

Verification is intended to assist the Chocolatey moderators and community
in verifying that this package's contents are trustworthy.

The embedded software has been downloaded from the listed download
location on <http://release.tinymediamanager.org/>
The embedded software have been downloaded from the listed download
location on <yup>
and can be verified by doing the following:

1. Download the following:

url: <https://release.tinymediamanager.org/v5/dist/tinyMediaManager-5.0.3-windows-amd64.zip>

2. You can obtain the checksum using one of the following methods:
- Use powershell function 'Get-FileHash'
- Use Chocolatey utility 'checksum.exe'
1. Download the following <yup>
2. Get the checksum using one of the following methods:
- Using powershell function 'Get-FileHash'
- Use chocolatey utility 'checksum.exe'
3. The checksums should match the following:

checksum type: sha256
checksum: 2BC86688454FE57AF1FA66A5818EC69EE1ABCDCC8CE93C5DF357AD4475B1CE91

Using AU:

Get-RemoteChecksum
checksum: D40AC6EC29DE25163DCBAAD86958CD53A2FA46C52056F8E9C2DD3B45DF961AB1

The file 'LICENSE.txt' is obtained from:
<https://gitlab.com/tinyMediaManager/tinyMediaManager/-/blob/devel/LICENSE>
The file 'LICENSE.txt' has been obtained from <https://gitlab.com/tinyMediaManager/tinyMediaManager/-/blob/devel/LICENSE>
37 changes: 37 additions & 0 deletions automatic/tinymediamanager/package.Tests.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
. "$PSScriptRoot\..\..\scripts\Run-PesterTests.ps1"

$packageName = Split-Path -Leaf $PSScriptRoot

Run-PesterTests `
-packageName "$packageName" `
-packagePath "$PSScriptRoot" `
-expectedEmbeddedMatch "^tinyMediaManager-[\d\.]+-windows-amd64\.zip$" `
-expectedDefaultDirectory "C:\tools\tinyMediaManager" `
-expectedShimFiles "tinyMediaManagerCMD.exe" `
-customInstallChecks @(
{
It "Should create tinyMediaManager Start Menu shortcut" {
$startMenu = [System.Environment]::GetFolderPath('Programs')
"$startMenu\tinyMediaManager.lnk" | Should -Exist
}

It "Should create tinyMediaManager desktop shortcut" {
$desktop = [System.Environment]::GetFolderPath('Desktop')
"$desktop\tinyMediaManager.lnk" | Should -Exist
}
}
) `
-customUninstallChecks @(
{
It "Should remove tinyMediaManager Start Menu shortcut" {
$startMenu = [System.Environment]::GetFolderPath('Programs')
"$startMenu\tinyMediaManager.lnk" | Should -Not -Exist
}

It "Should remove tinyMediaManager desktop shortcut" {
$desktop = [System.Environment]::GetFolderPath('Desktop')
"$desktop\tinyMediaManager.lnk" | Should -Not -Exist
}
}
) `
-failsOn32bit
18 changes: 11 additions & 7 deletions automatic/tinymediamanager/tinymediamanager.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<id>tinymediamanager</id>
<version>5.0.3</version>
<title>tinyMediaManager</title>
<authors>https://gitlab.com/tinyMediaManager/tinyMediaManager/-/graphs/devel</authors>
<owners>JourneyOver AdmiringWorm</owners>
<authors>Manuel Laggner</authors>
<owners>AdmiringWorm,JourneyOver</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<licenseUrl>https://gitlab.com/tinyMediaManager/tinyMediaManager/-/blob/devel/LICENSE</licenseUrl>
<projectUrl>https://www.tinymediamanager.org/</projectUrl>
Expand All @@ -22,12 +22,16 @@
#### Package
* Automatically built and uploaded by [JourneyOver](https://chocolatey.org/profiles/JourneyOver)
* If you have any requests or issues with this package please make an issue [here](https://github.com/JourneyOver/chocolatey-packages) instead of "Contact Maintainers"</releaseNotes>
<copyright>© 2022 Manuel Laggner</copyright>
<tags>tinymediamanager media managment tinyMediaManager metadata XBOX Media Center XBMC Plex Emby Freemium</tags>
<copyright>© 2024 Manuel Laggner</copyright>
<tags>tinymediamanager media-managment media-manager kodi xbmc plex emby
foss cross-platform</tags>
<projectSourceUrl>https://gitlab.com/tinyMediaManager/tinyMediaManager</projectSourceUrl>
<packageSourceUrl>https://github.com/AdmiringWorm/chocolatey-packages/tree/master/automatic/tinymediamanager</packageSourceUrl>
<docsUrl>https://www.tinymediamanager.org/docs</docsUrl>
<mailingListUrl>https://forum.kodi.tv/forumdisplay.php?fid=204</mailingListUrl>
<packageSourceUrl>https://github.com/admiringworm/chocolatey-packages/tree/master/automatic/tinymediamanager</packageSourceUrl>
<docsUrl>https://www.tinymediamanager.org/docs/</docsUrl>
<bugTrackerUrl>https://gitlab.com/tinyMediaManager/tinyMediaManager/-/issues</bugTrackerUrl>
</metadata>
<files>
<file src="legal\**" target="legal" />
<file src="tools\**" target="tools" />
</files>
</package>
51 changes: 37 additions & 14 deletions automatic/tinymediamanager/tools/chocolateyInstall.ps1
Original file line number Diff line number Diff line change
@@ -1,19 +1,42 @@
$ErrorActionPreference = 'Stop';

Write-Host "Cleaning up leftover from old packages"

$linkName = 'tinyMediaManager.lnk'
$publicDesktop = "${env:Public}\Desktop\$linkName"
$publicStartMenu = "${env:ProgramData}\Microsoft\Windows\Start Menu\Programs\$linkName"

if (Test-Path $publicDesktop) {
Remove-Item $publicDesktop -EA 0
}

if (Test-Path $publicStartMenu) {
Remove-Item $publicStartMenu -EA 0
}

$toolsDir = Split-Path -Parent $MyInvocation.MyCommand.Definition
$destination = Get-ToolsLocation

$packageArgs = @{
packageName = ''
fileType = ''
softwareName = ''

checksum = ''
checksum64 = ''
checksumType = ''
checksumType64= ''
url = ''
url64bit = ''

silentArgs = "/VERYSILENT"
validExitCodes= @()
packageName = $env:ChocolateyPackageName
file64 = "$toolsDir\"
SpecificFolder = 'tinyMediaManager'
Destination = $destination
}

Install-ChocolateyPackage @packageArgs
Get-ChocolateyUnzip @packageArgs

$destination = "$destination\tinyMediaManager"
$env:ChocolateyPackageInstallLocation = $destination

$guiTarget = "$destination\tinyMediaManager.exe"
$cmdTarget = "$destination\tinyMediaManagerCMD.exe"

$startMenu = [System.Environment]::GetFolderPath('Programs')
Install-ChocolateyShortcut -ShortcutFilePath "$startMenu\$linkName" -TargetPath "$guiTarget"
$desktop = [System.Environment]::GetFolderPath('Desktop')
Install-ChocolateyShortcut -ShortcutFilePath "$desktop\$linkName" -TargetPath $guiTarget

Install-BinFile -Name "tinyMediaManagerCMD" -Path $cmdTarget

Remove-Item $packageArgs.file64 -Force
27 changes: 22 additions & 5 deletions automatic/tinymediamanager/tools/chocolateyUninstall.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
$packageName = 'tinymediamanager'
$shortcutName = 'tinyMediaManager.lnk'
$ErrorActionPreference = 'Stop';

Remove-Item "$env:Public\Desktop\$shortcutName" -Force -ErrorAction 'SilentlyContinue'
Remove-Item "$env:ProgramData\Microsoft\Windows\Start Menu\Programs\$shortcutName" -Force -ErrorAction 'SilentlyContinue'
Remove-Item -r "C:\Tools\tinyMediaManager*" -ea 0 -Force
$startMenu = [System.Environment]::GetFolderPath("Programs")
$desktop = [System.Environment]::GetFolderPath('Desktop')
$linkName = "tinyMediaManager.lnk"

Uninstall-BinFile tinyMediaManagerCMD

if (Test-Path "$startMenu\$linkName") {
Write-Host "Removing Start Menu Icon"
Remove-Item "$startMenu\$linkName"
}
if (Test-Path "$desktop\$linkName") {
Write-Host "Removing Desktop Icon"
Remove-Item "$desktop\$linkName"
}

$installPath = "$(Get-ToolsLocation)\tinyMediaManager"

if (Test-Path $installPath) {
Write-Host "Removing installed files."
Remove-Item $installPath -Recurse -Force
}
40 changes: 28 additions & 12 deletions automatic/tinymediamanager/update.ps1
Original file line number Diff line number Diff line change
@@ -1,29 +1,45 @@
import-module au

$releases = ''
$releases = 'https://release.tinymediamanager.org'

function global:au_BeforeUpdate {
Get-RemoteFiles -Purge -NoSuffix
}

function global:au_SearchReplace {
@{
".\legal\VERIFICATION.txt" = @{
"(?i)(^\s*location on\:?\s*)\<.*>" = "`${1}<$releases>"
"(?i)(\s*1\..+)\<.*\>" = "`${1}<$($Latest.URL64)>"
"(?i)(^\s*checksum\s*type\:).*" = "`${1} $($Latest.ChecksumType64)"
"(?i)(^\s*checksum(64)?\:).*" = "`${1} $($Latest.Checksum64)"
}
".\tools\chocolateyInstall.ps1" = @{
"(^[$]url32\s*=\s*)('.*')" = "`$1'$($Latest.URL32)'"
"(^[$]url64\s*=\s*)('.*')" = "`$1'$($Latest.URL64)'"
"(^[$]checksum32\s*=\s*)('.*')" = "`$1'$($Latest.Checksum32)'"
"(^[$]checksum64\s*=\s*)('.*')" = "`$1'$($Latest.Checksum64)'"
"(^[$]checksumType32\s*=\s*)('.*')" = "`$1'$($Latest.ChecksumType32)'"
"(^[$]checksumType64\s*=\s*)('.*')" = "`$1'$($Latest.ChecksumType64)'"
"(?i)(^\s*file64\s*=\s*`"[$]toolsDir\\).*" = "`${1}$($Latest.FileName64)`""
}
}
}

function global:au_AfterUpdate($Package) {
Update-Changelog -useIssueTitle
Invoke-VirusTotalScan $Package
}

function global:au_GetLatest {
$download_page = Invoke-WebRequest -Uri $releases

$re = ''
$url = $download_page.links | ? href -match $re | select -First 1 -expand href
$re = 'windows.*.zip$'
$url = $download_page.links | ? href -match $re | select -First 1 -expand href

$version = $url -split '[-]' | select -Last 1 -Skip 2

$version = $url -split '[._-]|.exe' | select -Last 1 -Skip 2
$url = [uri]::new([uri]$releases, $url)

return @{ URL32 = $url; Version = $version }
return @{
URL64 = $url
ChecksumType64 = 'sha256'
Version = $version
}
}

update
update -ChecksumFor none

0 comments on commit 58f79b2

Please sign in to comment.