Skip to content

Commit 2ba7659

Browse files
committed
Merge branch 'pr/18'
2 parents 521e9fa + 2af90d5 commit 2ba7659

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

PMS_Updater.sh

+12-1
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,20 @@ LogMsg()
7979
## Converts the Plex version string to a mathmatically comparable
8080
## number by removing non numericals and padding each section with zeros
8181
## so v0.9.9.10.485 becomes 00000009000900100485
82+
## NOTE: Plex version numbers appear to have changed from something like
83+
## v0.9.14.4.1556-a10e3c2
84+
## to
85+
## v1.0.0.2261-a17e99e
86+
## Unfortunately this makes the new 1.X versions appear to be an older
87+
## version than the 0.9.X versions. This sed hack will append a .0 version
88+
## to the 1.X version so that it will now behave correctly. The new 1.X will
89+
## now looks omething like:
90+
## 1.0.0.2261.0-a17e99e
91+
## And will convert it to the proper long form such as:
92+
## 00010000000022610000
8293
verNum()
8394
{
84-
echo "$@" | awk -F '[^0-9]+' '{ printf("%04d%04d%04d%04d%04d", $1,$2,$3,$4,$5)}'
95+
echo "$@" | sed -e 's/^.*[^\.]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)\([^\.]\)/\1.0\2/' | awk -F. '{ printf("%04d%04d%04d%04d%04d", $1,$2,$3,$4,$5)}'
8596
}
8697

8798

0 commit comments

Comments
 (0)