by serendip1959 » Tue Jul 01, 2014 3:49 am
Hi
I have adapted your script for personal use to take Itunes xml exported by another music player and sync the play data (date last played and play count) to Media Monkey. Checking through the skipped tracks in the log I found that the fixhex function was not always decoding the file path correctly, again causing a failed match. I am not sure if the problem was in the source rather than the script, but found that changing the fixhex function increased the match count significantly by returning special characters such as in "Live In Gdańsk" correctly for example. I found also that characters such as - or " in the path were also not decoded correctly (again maybe due to source rather than script). I was unable to solve this problem, but as it affected only around 12 tracks I simply edited the paths in the source program and Media Monkey, attaining complete matches.
This is a great script, solved a big syncing problem I had.
My alternative to the fixhex function was
Code: Select all
Function Decode(fixhex)
Dim s1,s2,s3,d1,d2,b1,b2,b3
Dim i : i = InStr(fixhex,"%")
While (i > 0)
s1 = Mid(fixhex,i+1,2)
If IsHex(s1) Then
d1 = HexToDec(s1)
s1 = Left(fixhex,i-1)
s2 = Mid(fixhex,i+4,2)
If (Mid(fixhex,i+3,1) = "%") And (IsHex(s2)) Then
d2 = HexToDec(s2)
b1 = DecToBin(d1)
b2 = DecToBin(d2)
If (Left(b1,3) = "110") And (Left(b2,2) = "10") Then
b3 = Mid(b1,4)&Mid(b2,3)
s2 = Chrw(BinToDec(b3))
s3 = Mid(fixhex,i+6)
Else
s2 = Chrw(d1)
s3 = Mid(fixhex,i+3)
End If
Else
s2 = Chr(d1)
s3 = Mid(fixhex,i+3)
End If
fixhex = s1&s2&s3
End If
i = InStr(i+1,fixhex,"%")
Wend
Decode=Replace(fixhex,"'","'")
End Function
Hi
I have adapted your script for personal use to take Itunes xml exported by another music player and sync the play data (date last played and play count) to Media Monkey. Checking through the skipped tracks in the log I found that the fixhex function was not always decoding the file path correctly, again causing a failed match. I am not sure if the problem was in the source rather than the script, but found that changing the fixhex function increased the match count significantly by returning special characters such as in "Live In Gdańsk" correctly for example. I found also that characters such as - or " in the path were also not decoded correctly (again maybe due to source rather than script). I was unable to solve this problem, but as it affected only around 12 tracks I simply edited the paths in the source program and Media Monkey, attaining complete matches.
This is a great script, solved a big syncing problem I had.
My alternative to the fixhex function was
[code]
Function Decode(fixhex)
Dim s1,s2,s3,d1,d2,b1,b2,b3
Dim i : i = InStr(fixhex,"%")
While (i > 0)
s1 = Mid(fixhex,i+1,2)
If IsHex(s1) Then
d1 = HexToDec(s1)
s1 = Left(fixhex,i-1)
s2 = Mid(fixhex,i+4,2)
If (Mid(fixhex,i+3,1) = "%") And (IsHex(s2)) Then
d2 = HexToDec(s2)
b1 = DecToBin(d1)
b2 = DecToBin(d2)
If (Left(b1,3) = "110") And (Left(b2,2) = "10") Then
b3 = Mid(b1,4)&Mid(b2,3)
s2 = Chrw(BinToDec(b3))
s3 = Mid(fixhex,i+6)
Else
s2 = Chrw(d1)
s3 = Mid(fixhex,i+3)
End If
Else
s2 = Chr(d1)
s3 = Mid(fixhex,i+3)
End If
fixhex = s1&s2&s3
End If
i = InStr(i+1,fixhex,"%")
Wend
Decode=Replace(fixhex,"'","'")
End Function
[/code]