Skip to content
This repository has been archived by the owner on May 9, 2022. It is now read-only.

Commit

Permalink
bring Lisa's changes across
Browse files Browse the repository at this point in the history
  • Loading branch information
Robbie Clutton committed Jun 13, 2011
1 parent a838694 commit f98f6f9
Showing 1 changed file with 6 additions and 0 deletions.
Expand Up @@ -19,6 +19,7 @@ case class ArtistProfile(name: String, url: String, bio: ArtistBiography, tags:
case class ArtistProfileSimple(name: String, url: String, mbid: Option[String], image: List[ArtistImage]) {
lazy val trimmedMbid = mbid map { _.trim } filter { !_.isEmpty }
lazy val trimmedName = Trimmer.trimName(name)
lazy val trimmedNameWide = Trimmer.trmNameWide(name)
}
case class ArtistTags(tag: List[ArtistTag])
case class ArtistTag(name: String, url: String)
Expand Down Expand Up @@ -59,6 +60,11 @@ object Trimmer {
if (word.length > 12) word.substring(0, 12) + "... "
else word + " ") mkString
}

def trimNameWide(name: String) = {
name.split(" ").map(word =>
if (word.length > 16) word.substring(0, 16) + "... "
else word + " ") mkString
}

object ArtistProfileByName extends LastfmApi {
Expand Down

0 comments on commit f98f6f9

Please sign in to comment.