anchor.diff:      T = fun() -> mnesia:read(podrec_feed, LocalName) end,
       case mnesia:transaction(T) of
           {atomic, [Feed]} ->
  -            {ok, Feed#podrec_feed.orig_url};
  +            {ok, Feed#file.orig_url};
           {atomic, []} ->
               ConfiguredFeeds = podrec_util:get_env(feeds),
               case maps:get(LocalName, ConfiguredFeeds, undefined) of
                   undefined -> {error, unknown_feed};
                   OriginalUrl ->
  -                    ok = add_feed_to_db(#podrec_feed{local_name=LocalName, orig_url=OriginalUrl}),
  +                    ok = add_feed_to_db(#file{local_name=LocalName, orig_url=OriginalUrl}),
                       {ok, OriginalUrl}
               end
       end.
   
  -add_feed_to_db(Feed) when is_record(Feed, podrec_feed) ->
  -    lager:info("adding ~p to database", [Feed#podrec_feed.local_name]),
  -    {atomic, ok} = mnesia:transaction(fun() -> mnesia:write(Feed) end),
  +add_feed_to_db(Feed) when is_record(Feed, file) ->
  +    lager:info("adding ~p to database", [Feed#file.local_name]),
  +    {atomic, ok} = mnesia:transaction(fun() -> mnesia:write(podrec_feed, Feed, write) end),
       ok.
   
   
  
positive.code: update_feed_recency(LocalName) when is_binary(LocalName) ->
      Now = erlang:system_time(seconds),
      T = fun() -> [Feed] = mnesia:read(podrec_feed, LocalName),
                   mnesia:write(Feed#podrec_feed{last_fetch=Now})
          end,
      {atomic, ok} = mnesia:transaction(T),
      ok.
  
negative.code: 
  -record(state, {jobs=#{}}).
  
  -record(file, {local_name, orig_url, last_fetch}).
  
  -compile(export_all).
  
  