UberMouse

Untitled

Apr 25th, 2012
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.62 KB | None | 0 0
  1.    def main(args: Array[String]) {
  2.     addMedia()
  3.     val data = for {media: MediaInfo <- mediaCollection}
  4.     yield {
  5.       media.mediaType match {
  6.         case "Movie" => "Movie:" + media.folderName
  7.         case "Game" => "Game:" + media.folderName
  8.         case "TvShow" => media match {
  9.           case tvShow: TvShow => "TvShow:" + tvShow.mediaInfo.folderName + ":Seasons:" + tvShow.seasons
  10.           case _ => throw new ClassCastException("Invalid type for MediaInfo, can't cast to TvShow")
  11.         }
  12.       }
  13.     }
  14.     Runtime.getRuntime.exec("curl --data-urlencode \"data="+data.mkString(";:;")+"\" "+ POST_URL)
  15.   }
Advertisement
Add Comment
Please, Sign In to add comment