Hi,
making my first steps in C# (I'm a Delphi and scripting guy), I adressed the bugs reported here and here, being:
- tracks containing special characters in .m3u playlists were skipped as well as not displayed properly
- track lengths in .pls playlists were off by a factor of 1000 seconds
- relative paths in .pls playlists didn't work
Here's what I changed:
Core.PlayList.PlayListM3uIO.cs:
Line 59, old code:
new code:
This took care of the problem with special chars in .m3u playlists.
Core.PlayList.PlayListPLSIO.cs:
Commented out line 138
This fixed the faulty track length display.
Lines 142-146, old code:
New code (just inserted one LOC inbetween):
This fixed the handling of relative paths.
BTW I'm not sure if the assignment of the newItem.Type is correct in this last piece of code. But since it's been working for me so far, I left it alone. Someone with more inside knowledge may verify this.
Cheers...
making my first steps in C# (I'm a Delphi and scripting guy), I adressed the bugs reported here and here, being:
- tracks containing special characters in .m3u playlists were skipped as well as not displayed properly
- track lengths in .pls playlists were off by a factor of 1000 seconds
- relative paths in .pls playlists didn't work
Here's what I changed:
Core.PlayList.PlayListM3uIO.cs:
Line 59, old code:
Code:
using (file = new StreamReader(playlistFileName))
Code:
Encoding fileEncoding = Encoding.Default;
FileStream stream = File.Open(playlistFileName, FileMode.Open, FileAccess.Read, FileShare.Read);
using (file = new StreamReader(stream, fileEncoding, true))
Core.PlayList.PlayListPLSIO.cs:
Commented out line 138
Code:
//duration *= 1000;
Lines 142-146, old code:
Code:
if (tmp.IndexOf("http:") < 0 && tmp.IndexOf("mms:") < 0 && tmp.IndexOf("rtp:") < 0)
{
MediaPortal.Util.Utils.GetQualifiedFilename(basePath, ref fileName);
newItem.Type = PlayListItem.PlayListItemType.AudioStream;
}
Code:
if (tmp.IndexOf("http:") < 0 && tmp.IndexOf("mms:") < 0 && tmp.IndexOf("rtp:") < 0)
{
MediaPortal.Util.Utils.GetQualifiedFilename(basePath, ref fileName);
newItem.FileName = fileName;
newItem.Type = PlayListItem.PlayListItemType.AudioStream;
}
BTW I'm not sure if the assignment of the newItem.Type is correct in this last piece of code. But since it's been working for me so far, I left it alone. Someone with more inside knowledge may verify this.
Cheers...