Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: playlist_loader::is_our_content_type() problem (Read 3594 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

playlist_loader::is_our_content_type() problem

I am trying to implement a playlist reader for a certain playlist format.  It works fine when the playlist is loaded from the hard disc.  It works when the playlist is loaded from the web using File->Add location... and the URI contains the correct extension.  But it does not work when the extension is not part of the URI even though the content type is sent correctly by the server (foobar2000 just inserts a single entry into the playlist, and treats it as an audio file, not as a playlist file).

It seems that the function playlist_loader::is_our_content_type() is not even being called.  What am I doing wrong?  When the file extension is not present, why isn't foobar checking the content type instead of blindly inserting the entry into playlist as an audio file?

I only have a class derived from playlist_loader in the component and nothing else.

playlist_loader::is_our_content_type() problem

Reply #1
You aren't doing anything wrong. Content type handling in playlist_loader::g_load_playlist() has been disabled at some point in the past to avoid opening every file. Since the current version allows getting the content type without opening a file, the code has been fixed to include this check again. However, you will not get the benefit of that until a new version of foobar2000 is released.

I only have a class derived from playlist_loader in the component and nothing else.

Adding DECLARE_COMPONENT_VERSION wouldn't hurt, when you release it eventually.

 

playlist_loader::is_our_content_type() problem

Reply #2
Thanks for the reply! 

Adding DECLARE_COMPONENT_VERSION wouldn't hurt, when you release it eventually.

I am still a beginner, so it might take a while until I get there...  But---thanks to your tutorial---I did include a DECLARE_COMPONENT_VERSION