7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/podrb/commands/update/runner.rb', line 7
def call(podcast_id, options = {})
parsed_options = parse_options(options)
return build_failure_response(details: :invalid_options) if parsed_options.empty?
db = Infrastructure::Storage::SQL.new(db: podrb_db_dir)
if db.query("select id from podcasts where id = #{podcast_id}").empty?
return build_failure_response(details: :not_found)
end
sql_code = " update podcasts\n set feed = '\#{options[\"feed\"]}'\n where id = \#{podcast_id};\n SQL\n db.execute(sql_code)\n build_success_response(details: :podcast_updated)\nend\n"
|