Zeugma440 / atldotnet

Fully managed, portable and easy-to-use C# library to read and edit audio data and metadata (tags) from various audio formats, playlists and CUE sheets
MIT License
454 stars 61 forks source link

Several Playlist Format can't be opened by other software. #33

Closed DividedSEv2 closed 5 years ago

DividedSEv2 commented 5 years ago

The problem

I saved 5 songs using atl 2.9 in all the formats supported by atl 2.9 (asx,b4s,wax,wvx,m3u,m3u8,pls,xspf,smi,smil,wpl). Only m3u,m3u8 & pls properly opened in vlc & musicbee. Atl 2.9 can open all playlist files but the spaces in filepath's replaced by %20 so bass(by un4seen) cant find the address of the song. Even if i manully replace %20 by space in other playlist's vlc & musicbee still cant load it. note:- Playlist formats(in notepad) are totally different than the samples provided in atl.

Environment

Details

If necessary, describe the problem you have been experiencing in more detail.

Don't forget to include ATL.Logging.Log and/or console output

Code To Reproduce Issue [ Good To Have ]

private readonly string _playlistFilter = Properties.Resources.PFilter; private readonly string _savelistFilter = Properties.Resources.SFilter;

region Playlist

    private void LpMi_Click(object sender, RoutedEventArgs e)
    {
        var openFile = new OpenFileDialog()
        {
            Filter = _playlistFilter
        };
        if (openFile.ShowDialog() != true) return;
        var theReader = PlaylistIOFactory.GetInstance().GetPlaylistIO(openFile.FileName);
        foreach (var s in theReader.FilePaths)
        {
            LBoxSongPaths.Items.Add(s);
            LBoxSongNames.Items.Add(Path.GetFileNameWithoutExtension(s));
        }
    }

    private void SpMi_Click(object sender, RoutedEventArgs e)
    {
        var saveFile = new SaveFileDialog()
        {
            Filter = _savelistFilter
        };
        if (saveFile.ShowDialog() != true) return;
        var pls = PlaylistIOFactory.GetInstance().GetPlaylistIO(saveFile.FileName); //Example 1.asx
        IList<string> pathsToWrite = new List<string>();
        foreach (var item in LBoxSongPaths.Items)
        {
            pathsToWrite.Add(item.ToString());
        }
        pls.FilePaths = pathsToWrite;
    }
DividedSEv2 commented 5 years ago

Note *.pls format may not work also in vlc. Mine working becaz i fixed my code as it mentioned in my previous bug report.

Zeugma440 commented 5 years ago

Thanks for the report.

I'll have to test exhaustively the generated files with commercial software to discover how far from the specs their implementation is (which I should have done from the beginning).

According to what you're saying, the issue happens mostly on XML-based formats. There might be a quirk I didn't activate to make the generated XML files more readable.

I'll let you know shortly.

Zeugma440 commented 5 years ago

I've changed the layout of generated XML files and fixed a couple of issues.

Could you check again with the latest commit and tell me if there are remaining issues on your side ?

Best regards, ~Z440

DividedSEv2 commented 5 years ago

I tested after your fixes. Result:-

ATL 2.9:- Read & Write All Worked VLC- Problem Opening only b4s & m3u8;---- MusicBee - Problem Opening only xspf;---- AIMP - Problem Opening only xspf;---- // Though some songs showing as radio(still playing), not as local files. Winamp - Problem opening only asx,b4s,xspf & wpl; Itunes - only worked m3u,m3u8 & pls.

I think problem not solved yet. Cant test smi,smil only itunes support it but didn't open.
I will do more testing & let u know later tomorrow this time.

Zeugma440 commented 5 years ago

Thanks for the quick answer !

Regarding B4S, I actually tried fixing "B4S vs. VLC" with multiple variants, but nothing seems to work so far. I suspect their B4S parser to be broken.

Have you tried generating a legit B4S with Winamp and make it read by VLC ?

Which version of Winamp are you using, by the way ? B4S is a super old format that was created by Winamp itself and never documented...

Zeugma440 commented 5 years ago

Should be fine by now. I've made a whole lot of (retrocompatible) changes to create playlist I/O classes with the proper default settings while allowing to force other behaviours at creation-time.

Please refer to the Google Doc for the testing results. Some formats won't play properly on all readers; I've made default settings the ones that work on most readers with files that have exotic charsets.

DividedSEv2 commented 5 years ago

I Completed the testing on Excel Sheet. Make it Private and Add its link to main page so general public can see it. Delete the last line on that file. Thanks for fixing as fast as you can. Hope it develop more in future,

DividedSEv2 commented 5 years ago

Another think i want to say if u need some testing on tag management feature of ATL, I can also help on testing it. As i currently using another tag management library (that i dont want to say here publicly) which lack some format support but support better tag read/write of custom fields than atl. Maybe its my fault that i dont understanding how to use atl tag feature due to lack of examples. but atl is not working properly for my needs than that library last i test atl tag.

DividedSEv2 commented 5 years ago

I will contact you by email about tags in a week or two about it after some testing. You can remove ur email id & close this topic.

Zeugma440 commented 5 years ago

Awesome. I'll upload current version to NuGet in the meanwhile.

FYI, custom fields can be manipulated using IDictionary<string, string> Track.AdditionalFields

Working example

Track theTrack = new Track(audioFilePath);

// Writing
theTrack.AdditionalFields["fancyField"] = "42";
theTrack.Save();

// Reading
String value = "";
if (theTrack.AdditionalFields.ContainsKey("fancyField")) value = theTrack.AdditionalFields["fancyField"];