New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Humanreadable duration search enabled #186
Conversation
//qDebug()<<dbl<<durationHumanReadable.at(i); | ||
tempStr = ""; | ||
} | ||
else{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
else
should be on the some line as the closing bracket
there are still some issues with your coding style. See the wiki and surrounding code for examples http://www.mixxx.org/wiki/doku.php/coding_guidelines Can you please fix those. Also you commit messages can/should be a bit more descriptive. See the following for example. http://robots.thoughtbot.com/5-useful-tips-for-a-better-commit-message you can change commit messages with I'll look over the rest in the afternoon |
I'm really sorry for my ignorance. |
Don't worry. Code reviews are there to catch stuff like this. yeah rebase will rewrite your history. That is ok here. Your are the only one working on this branch and github will automatically update any changes in your branch in this PR. I'd recommend that you experiment a bit with rebase, the rypress tutorial is interactivly!!. If you don't feel comfortable doing it I can do it when I merge this with master But to be clear it is NOT ok to do something like this on master or other branches where you work together with others. |
Thanks for comforting. |
Since this is a new feature, I'd prefer to hold off merging this until post-1.12. |
@@ -142,6 +142,12 @@ QString TextFilterNode::toSql() const { | |||
m_operator = operatorMatcher.cap(1); | |||
argument = operatorMatcher.cap(2); | |||
} | |||
// first check if the query is about duration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace this tab with four spaces
Hi @kBashar, thank you for your work! |
Should we create an "experimental" branch for "features we don't want to merge into trunk yet?" Usually I'd suggest we branch 1.12 and merge a patch like this into trunk, but RJ had some reason for not cutting a release branch. The alternative is the contributor keeps their branch up to date with trunk, but that's not really reasonable to expect (and it doesn't happen). |
or we just mark this as a milestone for 1.13. Then we after the release we can filter all PR's and merge the ones marked for 1.13 |
I like the Idea to have a separate branch. Since we are on git, it is no deal to make this to "master" once the time has come. "Experimental" sounds to unstable to me, what about "post_1.12" The most easy solution is to treat this just like a bugfix and merge it to master once it is finished
|
This. The PR fixes an existing feature. |
what's the bug number this is fixing? |
It's in wishlist and the Bug number is #1261493 (Support human-readable time suffixes in time-based search query filters) |
It's called wishlist and it's a feature request, so it's not a bugfix. If we call every feature a bugfix then feature freeze has no meaning. I appreciate the tests, and the relatively small scope, but this type of feature creep has really hurt us in the past. |
I also agree that this is a wishlist bug and should go into 1.13 @kBashar the code seems fine if you address the style issues. Also can you add checks in the tests for the old way of just typing the seconds. |
Addresses this (https://bugs.launchpad.net/mixxx/+bug/1261493) wishlist bug MIXXX can only search duration in seconds. Searching tracks with duration keyword is made more natural. User can search now in following formats 2:30/2:30m 2:30:45/2:30:45h 2m30s/2m30 2h30m45s/2h30m45 In user manual we should encourage our users to use top two formats.
@kain88-de I've updated this PR. sorry for late, busy with college schedule. |
@ywwg: Do you have still objection to merge this? I am afraid it will start to rod at some point. |
@@ -164,6 +170,122 @@ NumericFilterNode::NumericFilterNode(const QStringList& sqlColumns, | |||
|
|||
} | |||
|
|||
QString NumericFilterNode::parseHumanReadableTime(QString durationHumanReadable) { | |||
QStringList durationRanges = durationHumanReadable.split("-"); | |||
qDebug()<<durationHumanReadable; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this debug
if (inputDuration.endsWith("h",Qt::CaseInsensitive)) { | ||
inputDuration.chop(1); | ||
} | ||
QStringList timeSeparated = inputDuration.split(colone_regexp); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just inline the colon_regexp.
I agree our feature freeze has kind of exploded :). But it looks like this PR needs a little more work before we can merge it. |
@ywwg sorry for not being perfect. thanks for your suggestions. I'll check and fix these within tomorrow. |
@ywwg I've updated. would you please give it a check? |
@@ -142,6 +142,12 @@ NumericFilterNode::NumericFilterNode(const QStringList& sqlColumns, | |||
m_operator = operatorMatcher.cap(1); | |||
argument = operatorMatcher.cap(2); | |||
} | |||
// first check if the query is about duration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think all search code is supposed to go in searchqueryparser.cpp
Sorry for the delay. I've made more notes. I know that some of them are pretty major, but there's lots of cool stuff to learn along the way :) |
@kBashar are you still working on this? |
Reworked this in #327 |
GitHub Actions: Add check if build is warning free
Now MIXXX can support duration search for following style
2:30
2m30s
150
i have added test code with it.