[standard] fix violations
This commit is contained in:
@@ -21,13 +21,13 @@ module Adamantium
|
|||||||
tracks = lastfm.user.get_weekly_track_chart(user: "dNitza", from: start_date, to: end_date)
|
tracks = lastfm.user.get_weekly_track_chart(user: "dNitza", from: start_date, to: end_date)
|
||||||
|
|
||||||
track = if tracks.is_a? Array
|
track = if tracks.is_a? Array
|
||||||
tracks.first
|
tracks.first
|
||||||
else
|
else
|
||||||
tracks
|
tracks
|
||||||
end
|
end
|
||||||
|
|
||||||
if track
|
if track
|
||||||
mb_id = track["mbid"] == {} ? "unknown" : track["mbid"]
|
mb_id = (track["mbid"] == {}) ? "unknown" : track["mbid"]
|
||||||
top_track_repo.upsert(post_id: post.id, name: track["name"], artist: track.dig("artist", "content"), url: track["url"], mb_id: mb_id)
|
top_track_repo.upsert(post_id: post.id, name: track["name"], artist: track.dig("artist", "content"), url: track["url"], mb_id: mb_id)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@@ -10,7 +10,7 @@ module Adamantium
|
|||||||
def upsert(post_id:, name:, artist:, url:, mb_id:)
|
def upsert(post_id:, name:, artist:, url:, mb_id:)
|
||||||
top_tracks
|
top_tracks
|
||||||
.upsert({name: name, artist: artist, url: url, mb_id: mb_id, post_id: post_id},
|
.upsert({name: name, artist: artist, url: url, mb_id: mb_id, post_id: post_id},
|
||||||
{ target: :post_id, update: {name: name, artist: artist, url: url, mb_id: mb_id, post_id: post_id} })
|
{target: :post_id, update: {name: name, artist: artist, url: url, mb_id: mb_id, post_id: post_id}})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@@ -14,4 +14,4 @@ require_relative "support/feature_loader"
|
|||||||
|
|
||||||
Gem.path.each do |path|
|
Gem.path.each do |path|
|
||||||
Warning.ignore(//, path)
|
Warning.ignore(//, path)
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user