#---------------------------------------------------------------
# ____                   _ _         ____  _
#|  _ \ ___  _   _  __ _| | |_ _   _/ ___|| |__   __ _ _ __ ___
#| |_) / _ \| | | |/ _` | | __| | | \___ \| '_ \ / _` | '__/ _ \
#|  _ < (_) | |_| | (_| | | |_| |_| |___) | | | | (_| | | |  __/
#|_| \_\___/ \__, |\__,_|_|\__|\__, |____/|_| |_|\__,_|_|  \___|
#            |___/             |___/
#
# Copyright (C) 2010 RoyaltyShare, Inc.   All Rights Reserved
#---------------------------------------------------------------

package RPS::Import::TopSpin::v1;

use strict;

use lib '/app/tools/common/lib';
use Common::Assert;

use lib '/app/tool/common/lib';
use Common::Country;

use lib '/app/tools/rps/lib';
use RPS::Import::ServiceMap;
use base 'RPS::Import::Importer';

sub _fieldMap {
    {
        countryCode  => 'BB',
        dateBegin    => 'G',
        dateEnd      => 'G',
        artistName   => 'E',
        albumName    => 'AA',
        units        => 'P',
        currencyCode => 'I',
        price        => 'V',
    };
}

sub _headerIdentifier { ( artistName => 'Artist Name' ) }

sub mediaType   { RPS::DB::Item::MediaType::kMediaTypeAudio }
sub productType { RPS::File::Sale::TYPE_ALBUM }
sub formatType  { RPS::File::Sale::FORMAT_DOWNLOAD }

sub albumName {
    my $self = shift;

    my $albumName = $self->_getByFieldName('albumName');

    $albumName =~ s/ - Digital$//;

    return $albumName;
}

###
1;    # Play nicely.
###
