28 @param api: an instance of L{Api} 29 @type api: L{Api} 30 @param name: the album name
- 31 @type name: str
+ 31 @type name: L{str} 32 @param artist: the album artist name 33 @type artist: L{Artist} 34 @param id: the album ID
- 35 @type id: str
+ 35 @type id: L{str} 36 @param mbid: MBID of the album
- 37 @type mbid: str
+ 37 @type mbid: L{str} 38 @param url: URL of the album on last.fm
- 39 @type url: str
+ 39 @type url: L{str} 40 @param release_date: release date of the album
- 41 @type release_date: datetime.datetime
+ 41 @type release_date: C{datetime.datetime} 42 @param image: the cover images of the album in various sizes
- 43 @type image: dict
+ 43 @type image: L{dict} 44 @param stats: the album statistics 45 @type stats: L{Stats} 46 @param top_tags: top tags of the album
- 47 @type top_tags: list of L{Tag}
+ 47 @type top_tags: L{list} of L{Tag} 48 @param streamable: flag indicating if the album is streamable
- 49 @type streamable: bool
+ 49 @type streamable: L{bool} 50 51 @raise InvalidParametersError: If an instance of L{Api} is not provided as the first 52 parameter then an Exception is raised.
@@ -226,78 +226,108 @@ lastfm.track.Track.streamable" class="py-name" href="#" onclick="return doclink(
74 75@property
123"""
+124 release date of the album
+125 @rtype: C{datetime.datetime}
+126 """
+127ifself._release_dateisNone:
+128self._fill_info()
-111returnself._release_date
-
166"""
-167 Get the data for the album.
-168
-169 @param api: an instance of L{Api}
-170 @type api: L{Api}
-171 @param artist: the album artist name
-172 @type artist: str OR L{Artist}
-173 @param album: the album name
-174 @type album: str
-175 @param mbid: MBID of the album
-176 @type mbid: str
-177
-178 @return: an Album object corresponding the provided album name
-179 @rtype: L{Album}
-180
-181 @raise lastfm.InvalidParametersError: Either album and artist parameters or
-182 mbid parameter has to be provided.
-183 Otherwise exception is raised.
-184
-185 @note: Use the L{Api.get_album} method instead of using this method directly.
-186 """
-187data=Album.196
+197@staticmethod
+
202"""
+203 Get the data for the album.
+204
+205 @param api: an instance of L{Api}
+206 @type api: L{Api}
+207 @param artist: the album artist name
+208 @type artist: L{str} OR L{Artist}
+209 @param album: the album name
+210 @type album: L{str}
+211 @param mbid: MBID of the album
+212 @type mbid: L{str}
+213
+214 @return: an Album object corresponding the provided album name
+215 @rtype: L{Album}
+216
+217 @raise lastfm.InvalidParametersError: Either album and artist parameters or
+218 mbid parameter has to be provided.
+219 Otherwise exception is raised.
+220
+221 @note: Use the L{Api.get_album} method instead of using this method directly.
+222 """
+223data=Album._fetch_data(api,album,mbid)
-188a=Album(
-189api,
-190224a=Album(
+225api,
+226name=data.findtext('name'),
-191227artist=Artist(
-192api,
-193228api,
+229name=data.findtext('artist'),
-194),
-195)
-196a.230),
+231)
+232a._fill_info()
-197returna
-
236ifnot(self.artistandself.name):
-201raiseInvalidParametersError("artist and album have to be provided.")
-202params={'artist':self.237raiseInvalidParametersError("artist and album have to be provided.")
+238params={'artist':self.artist.name}
-203params.update(extra_params)
-204returnparams
-
247params={'method':'album.getInfo'}
+248ifnot((artistandalbum)ormbid):
-213raiseInvalidParametersError("either (artist and album) or mbid has to be given as argument.")
-214if249raiseInvalidParametersError("either (artist and album) or mbid has to be given as argument.")
+250ifartistandalbum:
-215params.update({'artist':251params.update({'artist':artist,'album':album})
-216elif252elifmbid:
-217params.update({'mbid':253params.update({'mbid':mbid})
-218returnapi.254returnapi._fetch_data(params).find('album')
-
261try:
-262returnhash("%s%s"%(kwds['name'],hash(kwds['artist'])))
-263exceptKeyError:
-264raiseInvalidParametersError("name and artist have to be provided for hashing")
-
297try:
+298returnhash("%s%s"%(kwds['name'],hash(kwds['artist'])))
+299exceptKeyError:
+300raiseInvalidParametersError("name and artist have to be provided for hashing")
+