Search - File type
Moderator: Moderators
Search - File type
First, this post might be completly wrong, move it, lock it, delete it... Sorry.
Second, the bugzilla doesn't work. Have tried to register three times with different emails, and I haven't got any email yet from it so far with the activation stuff...
So, the bug I think I have found is that if I choose the file type Video in the Search screen, so doesn't it look for .mkv files. I quickly "scanned" the sourcecode and found that .mkv was included under "Video", but I think it was in the last position. Maybe a loop that ends one step to early?
This bug might also be on the other values (Audio, Compressed...).
Once again, I'm sorry if this post is completly misplaced...
Second, the bugzilla doesn't work. Have tried to register three times with different emails, and I haven't got any email yet from it so far with the activation stuff...
So, the bug I think I have found is that if I choose the file type Video in the Search screen, so doesn't it look for .mkv files. I quickly "scanned" the sourcecode and found that .mkv was included under "Video", but I think it was in the last position. Maybe a loop that ends one step to early?
This bug might also be on the other values (Audio, Compressed...).
Once again, I'm sorry if this post is completly misplaced...
-
- Forum Moderator
- Posts: 1420
- Joined: 2003-04-22 14:37
-
- Forum Moderator
- Posts: 366
- Joined: 2004-03-06 02:46
Excuse my ignorance, but in which file in the sourcecode are the file types categorised as "video" etc?
I've had a look and can't see anything for the latest release. I was hoping to attempt a new function for my own use where I could click one button and search for 5 or 6 file types (which I don't permit on my own hub) at once rather than one at a time.
Thanks in advance
I've had a look and can't see anything for the latest release. I was hoping to attempt a new function for my own use where I could click one button and search for 5 or 6 file types (which I don't permit on my own hub) at once rather than one at a time.
Thanks in advance
Sorry, I've found this in
client/ShareManager.cpp:
Why are ape and shn (off the top of my head) omitted from audio? If I ever figure out how to compile I'll have a go at adding these as well as having a custom category ("banned") for my use. Sounds simple when you say it fast.
client/ShareManager.cpp:
Code: Select all
static const char* typeAudio[] = { ".mp3", ".mp2", ".mid", ".wav", ".ogg", ".wma" };
static const char* typeCompressed[] = { ".zip", ".ace", ".rar" };
static const char* typeDocument[] = { ".htm", ".doc", ".txt", ".nfo" };
static const char* typeExecutable[] = { ".exe" };
static const char* typePicture[] = { ".jpg", ".gif", ".png", ".eps", ".img", ".pct", ".psp", ".pic", ".tif", ".rle", ".bmp", ".pcx" };
static const char* typeVideo[] = { ".mpg", ".mov", ".asf", ".avi", ".pxp", ".wmv", ".ogm", ".mkv" };
static const string type2Audio[] = { ".au", ".aiff", ".flac" };
static const string type2Picture[] = { ".ai", ".ps", ".pict" };
static const string type2Video[] = { ".rm", ".divx", ".mpeg" };
-
- Forum Moderator
- Posts: 1420
- Joined: 2003-04-22 14:37
Things are never as simple as they seem. Making changes to your local definitions is irrelevant. The results you receive are from the other person. What results they send to you will be based on the list of extensions they have in their code. If they don't have ape and shn listed, you will never receive them, no matter what you do to your own client. Think about it.expstevie wrote:Why are ape and shn (off the top of my head) omitted from audio? If I ever figure out how to compile I'll have a go at adding these as well as having a custom category ("banned") for my use. Sounds simple when you say it fast.
Adding your own "type" is also limited like this, butt in a slightly more complex way.
OK - it seems as though I'm waiting for these to be added to an official release then.
Maybe someone can help with some other confusion. If I search for ".flac" then I obviously find lots of flac files (such as 08 Harvest.flac).
However, if I search for "Harvest" and choose "Audio" from the drop down list, I don't find the same file despite the pasted code, above, listing flac as a "type2audio".
I've tried this in v0.401 and 0.668
If it's as simple as "it's got to be listed in typeAudio[] = " then what does type2 do?
Anyone?
Maybe someone can help with some other confusion. If I search for ".flac" then I obviously find lots of flac files (such as 08 Harvest.flac).
However, if I search for "Harvest" and choose "Audio" from the drop down list, I don't find the same file despite the pasted code, above, listing flac as a "type2audio".
I've tried this in v0.401 and 0.668
If it's as simple as "it's got to be listed in typeAudio[] = " then what does type2 do?
Anyone?
-
- Forum Moderator
- Posts: 366
- Joined: 2004-03-06 02:46
Most file extensions are 3 characters, so when combined with the '.' they can be compared using a 32-bit integer comparison. The ones that are not 3 characters need to be put in a string class and compared using string comparisons. That's what I think it's for, anyway.
Note that deciding what extensions to use is searcher-side under the ADC protocol.
Note that deciding what extensions to use is searcher-side under the ADC protocol.
-
- DC++ Contributor
- Posts: 3212
- Joined: 2003-01-07 21:46
- Location: .pa.us
Presumably the results are different because the user's .flac files are more than 10 results into their matches for "Harvest." Or, you could be on a hub with many different DC++ versions - you need to look at the changelog to see which version a given extension was added at.expstevie wrote:Maybe someone can help with some other confusion. If I search for ".flac" then I obviously find lots of flac files (such as 08 Harvest.flac).
However, if I search for "Harvest" and choose "Audio" from the drop down list, I don't find the same file despite the pasted code, above, listing flac as a "type2audio".
Correct.PseudonympH wrote:That's what I think it's for, anyway.
-
- Forum Moderator
- Posts: 366
- Joined: 2004-03-06 02:46
Excuse my dumbness, lol.
True or false (in any version of DC++, or for simplicity, the recent 0.668):
1. Searching for files with a 3 letter file extension is carried out using a different technique than doing the same for a file with a 4 letter file extension.
2. If one user has 13 files which all include the string "Harvest" and I search for the string "Harvest" I'll find them all. If they have 13 .flac files and I search for "Harvest" in file type "Audio", I'll only find it if it's among the first 10 files found.
3. It's possible that "flac" files were not previously considered as "audio" and a changelog would show their introduction. It's possible that flac aren't really considered as audio (at least not as commonly as mp3 & this is reflected in the code for DC++) as they are included only in type2Audio rather than alongside mp3 in typeAudio.
4. In this same vein, the future inclusion of the yet to be introduced "ape" and "shn" as audio types is a simple change (in terms of code change, based on my quoted code excerpt, above).
Thanks in advance, all, you've been really helpful so far.
True or false (in any version of DC++, or for simplicity, the recent 0.668):
1. Searching for files with a 3 letter file extension is carried out using a different technique than doing the same for a file with a 4 letter file extension.
2. If one user has 13 files which all include the string "Harvest" and I search for the string "Harvest" I'll find them all. If they have 13 .flac files and I search for "Harvest" in file type "Audio", I'll only find it if it's among the first 10 files found.
3. It's possible that "flac" files were not previously considered as "audio" and a changelog would show their introduction. It's possible that flac aren't really considered as audio (at least not as commonly as mp3 & this is reflected in the code for DC++) as they are included only in type2Audio rather than alongside mp3 in typeAudio.
4. In this same vein, the future inclusion of the yet to be introduced "ape" and "shn" as audio types is a simple change (in terms of code change, based on my quoted code excerpt, above).
Thanks in advance, all, you've been really helpful so far.
-
- Forum Moderator
- Posts: 1420
- Joined: 2003-04-22 14:37
No. You will only ever receive 10 search results in active mode and 5 in passive mode. I think which results you receive are non-deterministic.expstevie wrote:2. If one user has 13 files which all include the string "Harvest" and I search for the string "Harvest" I'll find them all. If they have 13 .flac files and I search for "Harvest" in file type "Audio", I'll only find it if it's among the first 10 files found.
Yes.expstevie wrote:3. It's possible that "flac" files were not previously considered as "audio" and a changelog would show their introduction.
Yes, but with the restrictions outlined above. ie. it has to be a global change. Not just on an individual basis.expstevie wrote:4. In this same vein, the future inclusion of the yet to be introduced "ape" and "shn" as audio types is a simple change (in terms of code change, based on my quoted code excerpt, above).
I don't have definitive answers for the other questions.
-
- DC++ Contributor
- Posts: 3212
- Joined: 2003-01-07 21:46
- Location: .pa.us
What if part is true, and part is false? Or if the "truness" depends on context you didn't put in the question?expstevie wrote:True or false (in any version of DC++, or for simplicity, the recent 0.668):
true: DC++'s source code matches extensions differently for 3 and !3 letter extensions1. Searching for files with a 3 letter file extension is carried out using a different technique than doing the same for a file with a 4 letter file extension.
false: Users will never see this difference, it's only in the source code.
false: search results are limited to 10 in response to an active search, and 5 in response to passive searches.2. If one user has 13 files which all include the string "Harvest" and I search for the string "Harvest" I'll find them all. If they have 13 .flac files and I search for "Harvest" in file type "Audio", I'll only find it if it's among the first 10 files found.
If they have 13 .flac files containing "Harvest" (remember, path matches count too), audio or no type doesn't matter. Your scenario is constructed badly.
FYI, changelog.txt says:3. It's possible that "flac" files were not previously considered as "audio" and a changelog would show their introduction. It's possible that flac aren't really considered as audio (at least not as commonly as mp3 & this is reflected in the code for DC++) as they are included only in type2Audio rather than alongside mp3 in typeAudio.
Code: Select all
-- 0.402 2004-06-27 --
* .mkv and .flac added as file formats (thanks garg)
Yes, adding those extensions is a change to the typeAudio array. Making the extension list longer introduces more comparisons. If you have many files that don't fall into the listed extensions, this theoretically might lead to measurable CPU usage. Basically, only popular file types should go there, avoiding bloat, and corresponding with what "popular" extensions are shared.4. In this same vein, the future inclusion of the yet to be introduced "ape" and "shn" as audio types is a simple change (in terms of code change, based on my quoted code excerpt, above).
IMO, .ape and .shn should be converted to FLAC, since it's free-as-in-speech, which isn't the same as Monkey or Shorten. And, if you're storing lossless audio, you obviously don't care about disk space. =) Foobar2000 can do this easily, while preserving tags.
-
- DC++ Contributor
- Posts: 3212
- Joined: 2003-01-07 21:46
- Location: .pa.us
Ape's license agreement:expstevie wrote:ape and shn are free too. I know that shn is seen as a bit crap but I've nothing against ape files.
It's not free-as-in-speech.License Agreement
1. The use of any of the Monkey’s Audio source code or any component thereof from another program requires express written permission from the author of Monkey’s Audio.
2. The use of Monkey's Audio or the Monkey's Audio source code for any commercial purposes including, but not limited to, implementation in shareware packages is strictly prohibited without first obtaining written permission from the author.
3. All code changes and improvements must be contributed back to the Monkey's Audio project free from restrictions or royalties for the sake of the common good.
4. Although the software has been tested thoroughly, the author is in no way responsible for damages due to bugs or misuse.
5. If you do not completely agree with all of the previous stipulations, you must cease using this source code and remove it from your storage device.
Shorten
Therefore, it is also not free-as-in-speech.http://freshmeat.net/projects/shorten wrote:[License] Free for non-commercial use
Oh, sorry! I just meant that it doesn't cost us all anything to download and use Monkey's Audio. That's free enough for me so far as a user.
Seeing as ape files at Extra High compression are smaller than flac files - is there any hope of them being added to typeAudio? Sometimes audio *has* to be lossless
If need be I could code it myself & add "DC++ Contributor" to my CV.
Seeing as ape files at Extra High compression are smaller than flac files - is there any hope of them being added to typeAudio? Sometimes audio *has* to be lossless
If need be I could code it myself & add "DC++ Contributor" to my CV.
Code: Select all
static const char* typeAudio[] = { ".mp3", ".mp2", ".mid", ".wav", ".ogg", ".wma", ".ape" };
-
- Forum Moderator
- Posts: 587
- Joined: 2003-05-07 02:38
- Location: Sweden, Linkoping
This will be possible in the ADC protocol as you there can specify extension when searching. http://dcplusplus.sourceforge.net/ADC.htm#_Toc89885799
-
- Forum Moderator
- Posts: 366
- Joined: 2004-03-06 02:46
Incorrect.
String search term, where ++ is include, -- is exclude, and EX is extension. Each filename (including the path to it) should be matched using case insensitive substring search as follows: match all ++, remove those that match any --, and make sure the extension matches at least one of the EX (if it is present).
-
- DC++ Contributor
- Posts: 3212
- Joined: 2003-01-07 21:46
- Location: .pa.us
A single patch would technically be a contributor. If you have some better title for me, feel free to name it.expstevie wrote:If need be I could code it myself & add "DC++ Contributor" to my CV.
True, but in 20 years, you'll still be able to use FLAC, make hardware players for it, etc. You'll also have the same freedom to adapt DC++ source to the current computers, too - something you wouldn't be able to do with NMDC or Monkey Audio.expstevie wrote:That's free enough for me so far as a user.