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

package RPS::Import::Real::v8;

use strict;

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

sub _fieldMap {
    {
        labelName        => 'A',
        countryCode      => 'C',
        dateBegin        => 'R',
        dateEnd          => 'S',  
        formatType       => 'N',      
        artistName       => 'D',
        upc              => 'G',
        albumName        => 'E',
        isrc             => 'J',
        trackNum         => 'I',
        trackName        => 'F',
        units            => 'K',
        price            => 'M',

    }
}

sub _headerIdentifier { ( upc => 'UPC' ) }
sub mediaType    { RPS::DB::Item::MediaType::kMediaTypeAudio }
sub productType  { RPS::File::Sale::TYPE_TRACK }
sub currencyCode { 'USD' }

sub formatType { 
	my $self = shift;
	my $formatType = uc $self->_getByFieldName( 'formatType' );    

    if( $formatType eq 'S' ) {
        return RPS::File::Sale::FORMAT_STREAM;
    }
    elsif( $formatType eq 'T' ) {
        return RPS::File::Sale::FORMAT_DOWNLOAD;
    }

    $self->fail( "Unrecognized format type: $formatType" );
}







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