2013-03-28, 13:11
(2013-03-28, 02:49)FreddyKrueger Wrote:(2013-03-27, 02:33)FreddyKrueger Wrote: Hi guys
I'm having a problem with multipart movies and the associated poster/fanart.
having the files "whatever-cd1.avi" and "whatever-cd2.avi", should have "whatever-poster" and whatever-fanart"... but instead i get "whatever--poster" and "whatever--fanart" (two dashes instead of one).
Is it just me or is this a known bug??
My Ember version is 1.3.0.10.1
Thanks
This was bugging me alot... so i grab the source code, and fixed it.
What i did was :
In file clsAPIStringUtils.vb :
i just add a line to make it look like this :Code:Public Shared Function CleanStackingMarkers(ByVal sPath As String, Optional ByVal Asterisk As Boolean = False) As String
If AdvancedSettings.GetBooleanSetting("DisableMultiPartMedia", False) Then Return sPath
If String.IsNullOrEmpty(sPath) Then Return String.Empty
Dim sReturn As String = Regex.Replace(sPath, AdvancedSettings.GetSetting("DeleteStackMarkers", "\|?\-*\.*((cd|dvd|part|dis[ck])([0-9]))"), If(Asterisk, "*", " "), RegexOptions.IgnoreCase).Trim
If Not sReturn = sPath Then
Return Regex.Replace(sReturn, "\s\s(\s+)?", " ").Trim
Else
Return sPath
End If
End Function
I know it's not an elegant solution... but it's a functional one.Code:Public Shared Function CleanStackingMarkers(ByVal sPath As String, Optional ByVal Asterisk As Boolean = False) As String
If AdvancedSettings.GetBooleanSetting("DisableMultiPartMedia", False) Then Return sPath
If String.IsNullOrEmpty(sPath) Then Return String.Empty
Dim sReturn As String = Regex.Replace(sPath, AdvancedSettings.GetSetting("DeleteStackMarkers", "\|?\-*\.*((cd|dvd|part|dis[ck])([0-9]))"), If(Asterisk, "*", " "), RegexOptions.IgnoreCase).Trim
If sReturn.Last = "-" Then sReturn = sReturn.Remove(sReturn.Length - 1, 1)
If Not sReturn = sPath Then
Return Regex.Replace(sReturn, "\s\s(\s+)?", " ").Trim
Else
Return sPath
End If
End Function
I only tested this for movies, because i use ember only for movies... i don't use it for tvshows, nor dvd's
I've uploaded the file to dropbox... and here is the link : EmberAPI.zip
Just replace the EmberAPI.dll in ember folder, but first... make a backup of the existing one.
Careful guys... i take no responsability if this brakes your ember or your database.... this fix works for me and to a few friends that tested it also.
Regards
The correct way is to add (without If sReturn.Last = "-" Then sReturn = sReturn.Remove(sReturn.Length - 1, 1))
Code:
[\s_\-\.]?((cd|dvd|p(?:ar)?t|dis[ck])[\s_\-\.]*([0-9]))
in
clsAPIStringUtils.vb at position z43s105
and in
clsAdvancedSettings.vb at position z368s46 and z369s47
I have fix this for the next release.
With this regex should be the most common names work:
Avatar-CD1
Avatar-CD-1
Avatar CD.1
Avatar.pt 1
Avatar part-1
Avatar_disc_1
...