zealot128/podfilter.de

View on GitHub
app/controllers/admin_controller.rb

Summary

Maintainability
A
0 mins
Test Coverage
class AdminController < ApplicationController
  authorize_resource class: false

  def index
  end

  def duplicates
    @duplicates = DuplicateFinder.get_dupegroups.shuffle.take(50).map do |source_ids|
      Podcast.where id: Source.where(id: source_ids).select(:podcast_id)
    end
  end

  def merge
    others = Podcast.where(id: params[:source_ids])
    main = others.find(params[:target_id])
    main.merge(others)

    DuplicateWorker.perform_async
    @id = params[:html_id]
  end
end