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

use strict;

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

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

sub _fieldMap {
    {
        dateBegin        => 'B1',
        dateEnd          => 'B2',
        serviceProductID => 'B',
        artistName       => 'E',
        isrc             => 'C',
        trackName        => 'D',
        price            => 'H',
        units            => 'F',
        currencyCode     => 'B4',
        countryCode      => 'A',
    }
}

sub _headerIdentifier { ( isrc => 'ISRC' ) }

sub saleDates {
    my $self = shift;

    my $dateBegin;
    my $dateEnd;

    my $startDate = $self->_getDateBegin();
    my $endDate   = $self->_getDateEnd();

    if( $startDate && $endDate )
    {
        ($dateBegin,$dateEnd) = $self->_getDates( date_begin => $startDate, date_end => $endDate );
    }

    return ($dateBegin, $dateEnd);
}

sub productType { RPS::File::Sale::TYPE_TRACK; }

sub formatType { RPS::File::Sale::FORMAT_STREAM; }

sub mediaType { RPS::DB::Item::MediaType::kMediaTypeAudio; }

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