staleimages.rb

来自「Amarok是一款在LINUX或其他类UNIX操作系统中运行的音频播放器软件。 」· RB 代码 · 共 28 行

RB
28
字号
#!/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 + =
减小字号Ctrl + -
显示快捷键?