Bugzilla – Bug 5712
Advanced search for an exact duration doesn't find all occurances
Last modified: 2008-07-31 12:16:40 UTC
I searched for all tracks less than 30 seconds, and looked at the details for one track, which was 29 seconds long. I then searched for tracks that had a duration of 29 seconds, and found that the song from the previous search was not included in the results (other tracks were).
how about an arbitrary duration, does equals x always fail?
I tried this out with a couple tracks that I have at 28 seconds. both are found. for comparison, here is the output of database.sql in the log: [23:41:44.7500] Slim::Schema::Debug::query_start (26) SELECT COUNT( * ) FROM tracks me LEFT JOIN contributor_track contributorTracks ON ( contributorTracks.track = me.id ) WHERE ( ( ( contributorTracks.role = ? ) OR ( contributorTracks.role = ? ) ) AND secs = ? ): '1', '5', '28' [23:41:44.8722] Slim::Schema::Debug::query_start (26) SELECT me.id, me.url, me.content_type, me.title, me.titlesort, me.titlesearch, me.album, me.tracknum, me.timestamp, me.filesize, me.disc, me.remote, me.audio, me.audio_size, me.audio_offset, me.year, me.secs, me.cover, me.vbr_scale, me.bitrate, me.samplerate, me.samplesize, me.channels, me.block_alignment, me.endian, me.bpm, me.tagversion, me.drm, me.musicmagic_mixable, me.musicbrainz_id, me.playcount, me.lastplayed, me.lossless, me.lyrics, me.rating, me.replay_gain, me.replay_peak FROM tracks me LEFT JOIN contributor_track contributorTracks ON ( contributorTracks.track = me.id ) WHERE ( ( ( contributorTracks.role = ? ) OR ( contributorTracks.role = ? ) ) AND secs = ? ) ORDER BY me.disc, me.titlesort: '1', '5', '28'
I tried a few other exact equality durations. eg. I found a track that was 00:07 seconds (reported on song info page), and tried an exact equality search for 7 seconds duration. This didn't find the track. Nor did =6 seconds or =8 seconds, so it isn't rounding down or up. I tried to see the actual duration in various music tagging apps. Most round up or down to the nearest second, but DBPowerAmp explorer shell properties report this duration as 7.7 seconds. me.secs column is a float, but it is being passed an integer value. me.secs should be rounded to nearest second (in the same way as the info page must be rounding it)?
I will look at this.