?? staleimages.rb
字號:
#!/usr/bin/env ruby## script to remove stale images in the database## (c) 2006 Roland Gigler <rolandg@web.de># License: GNU General Public License V2system("dcop", "amarok", "playlist", "shortStatusMessage", "Removing stale 'images' entries from the database")qresult = `dcop amarok collection query "SELECT path FROM images;"`result = qresult.split( "\n" )i = 0result.each do |url| #puts "url: #{url}" unless FileTest.exist?( url ) i = i + 1 url.gsub!(/[']/, '\\\\\'') puts "Deleting: #{url}" system("dcop", "amarok", "collection", "query", "DELETE FROM images WHERE path = '#{url}'") endendif i > 0 system("dcop", "amarok", "playlist", "popupMessage" "Removed #{i} stale 'images' entries from the database")end
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -