main: Extend find_media_cb() to be more flexible

Instead of always comparing IDs, allow the type to compare to be
passed to the helper.
main: Don't allow adding duplicate items to recent

https://bugzilla.gnome.org/show_bug.cgi?id=729775