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

package RPS::Import::Beatport::v6;

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 {
    {
        labelName        => 'B',
        dateBegin        => 'A2',
        dateEnd          => 'B2',
        artistName       => 'H',
        upc              => 'C',
        isrc             => 'E',
        trackName        => 'F',
        albumName        => 'J',
        price            => 'L',
        units            => 'K',
        countryCode      => 'A',
        serviceProductID => 'D',
    };
}

sub _headerIdentifier { ( upc => 'UPC' ) }

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; }

sub currencyCode { 'USD' }

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