What is the form of this verb 頼まれてた?


I'm practicing understanding japanese by japanese subs of anime. For this
moment it is 10 episode of season 2 "Seitokai yakuindomo", the last scene.

[code]

    Here is Tsuda words:
    **あっ そうだ 買い物 頼まれてた んだ**
    Translation: Ah! By the way, I was asked to shop some things.
    
[/code]

I try to firugre out by parts and could not understand what form of verb for
頼む [tanomu] was used here.

[code]

    あっ そうだ [a: soda] Well, here is a thing.
    買い物 [kaimono] shopping
    頼まれてた [tanoma reteta] ???? what is the form of the verb
    んだ [nda] situation is the following.
    
[/code]

Is it past passive? If so, I could not find info that past passive exists in
japanese language. 頼まれる - is plain passive, but no past passive in the
vocabulary.

Does anyone knows what is the form of this verb in Tsuda's words?




How to get to 頼まれてたんだ

  * 頼む (tanom-u) is "ask a favor" 
  * 頼まれる (tanom-areru) is the passive form of the verb as you noticed 
  * 頼まれる is still a verb, so past form and progressive form can be derived for it. 
  * 頼まれている (tanomare-te iru) is the ["progressive"/"continuous state"](https://japanese.stackexchange.com/a/3140/1319) form (that conveys the meaning of "state of being asked for a favor") 
  * 頼まれていた (tanomare-te ita) is the ["discovery ta"/"modal-ta"](https://japanese.stackexchange.com/a/40888/1319) form (that conveys the feeling of having recalled something) 
  * Particle んだ is a form of ~のだ / ~のです about which you can find explanations about [here](http://www.guidetojapanese.org/particles3.html#part5)  
We now have 頼まれていたんだ。

  * Finally, in casual speech it is frequent that the い in the ~ている form gets dropped. This is how you get :  
頼まれてたんだ

Regarding the style of speech: I would say that dropping the い makes it sound
like the orator speaks in a bit of a hurry (because they have to do something
they had almost forgotten) ; and the presence of んだ sounds like it gives an
explanation for the hurriedness, as well as denoting some level of intimacy
with the interlocutor.

