stalestatistics.rb
来自「Amarok是一款在LINUX或其他类UNIX操作系统中运行的音频播放器软件。 」· RB 代码 · 共 26 行
RB
26 行
#!/usr/bin/env ruby## Ruby script to remove stale statistics in the database# (c) 2005 Seb Ruiz <me@sebruiz.net># License: GNU General Public License V2system("dcop", "amarok", "playlist", "shortStatusMessage", "Removing stale entries from the database")qresult = `dcop amarok collection query "SELECT url FROM statistics;"`result = qresult.split( "\n" )i = 0result.each do |url| unless FileTest.exist?( url ) i = i + 1 url.gsub!(/[']/, '\\\\\'') puts "Deleting: #{url}" system("dcop", "amarok", "collection", "query", "DELETE FROM statistics WHERE url = '#{url}'") endendif i > 0 system("dcop", "amarok", "playlist", "popupMessage", "Removed #{i} stale entries from the database")end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?