Skip to content

Commit

Permalink
LinkClean: Use MAX() for getting URL
Browse files Browse the repository at this point in the history
  • Loading branch information
vitorgalvao committed Apr 14, 2022
1 parent f43ed4b commit 6e1638d
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
Binary file modified LinkClean/LinkClean.alfredworkflow
Binary file not shown.
2 changes: 1 addition & 1 deletion LinkClean/source/info.plist
Expand Up @@ -495,7 +495,7 @@ Run `lc` and input a URL, or leave it blank to use your clipboard contents. Acti
</dict>
</dict>
<key>version</key>
<string>22.1</string>
<string>22.2</string>
<key>webaddress</key>
<string>http://vitorgalvao.com/</string>
</dict>
Expand Down
2 changes: 1 addition & 1 deletion LinkClean/source/linkclean_functions.rb
Expand Up @@ -32,7 +32,7 @@ def clipboard_url
Open3.capture2(
'/usr/bin/sqlite3',
"#{ENV['HOME']}/Library/Application Support/Alfred/Databases/clipboard.alfdb",
'SELECT item FROM clipboard WHERE dataType = 0 AND item LIKE "http%" ORDER BY ts DESC LIMIT 1;'
'SELECT item FROM (SELECT item,MAX(ts) FROM clipboard WHERE dataType = 0 AND item LIKE "http%");'
).first.chomp
end

Expand Down

0 comments on commit 6e1638d

Please sign in to comment.