kmedia

package
v1.5.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2021 License: MIT Imports: 29 Imported by: 1

Documentation

Index

Constants

View Source
const (
	CATALOGS_SOURCES_MAPPINGS_FILE = "importer/kmedia/data/Catalogs Sources Mappings - final.csv"
	CATALOGS_TAGS_MAPPINGS_FILE    = "importer/kmedia/data/catalogs_tags.csv"
)
View Source
const CHAPTERS_FILE = "importer/kmedia/data/programs_chapters.csv"
View Source
const CONGRESSES_FILE = "importer/kmedia/data/Conventions - congresses.csv"
View Source
const EXISTING_UNITS_FILE = "importer/kmedia/data/congress_units_exists_2.csv"
View Source
const NEW_UNITS_FILE = "importer/kmedia/data/congress_units_new_2.csv"

Variables

View Source
var ArticlesCatalogs = []int{
	8182,
	7916,
	7915,
	8183,
	8101,
	7902,
}
View Source
var ClipsCatalogs = []int{
	3673,
	4447,
	4661,
	4660,
	4659,
	3959,
	3953,
	4663,
	4703,
	4665,
	4678,
	4672,
	4675,
	4674,
	4669,
	4676,
	4671,
	4677,
	4673,
	4670,
	4662,
	4664,
	3954,
	3951,
	3952,
	4318,
	3935,
	3868,
	7907,
	7911,
	6935,
	4754,
	6955,
	4756,
	4770,
	4738,
	4758,
	7868,
	6953,
	4757,
	8039,
	7914,
	4751,

	8147,
	4759,
	4762,
	3906,
	4775,
	6962,
	4744,
	7901,
	6966,
	8126,
	7904,
	4774,
	8149,
	7909,
	4812,
	6951,
	7899,
	4823,
	4745,
	8188,
	3914,
	3947,
	4267,
	6939,
	8305,
	4765,
	4517,
	4746,
	4439,
	4007,
	6950,
	4444,
	4445,
	3909,
	4067,
}
View Source
var CountryCatalogs = map[int]string{
	7900: "Ukraine",
	8091: "Kazakhstan",
	4556: "Canada",
	4537: "United States",
	4536: "Russia",
	4543: "Estonia",
	4553: "Austria",
	4680: "Colombia",
	4563: "Switzerland",
	4544: "Spain",
	4549: "Argentina",
	4787: "Sweden",
	4788: "Bulgaria",
	2323: "Mexico",
	4545: "Italy",
	4552: "Chile",
	4667: "Brazil",
	4551: "England",
	4547: "Germany",
	4550: "Turkey",
	7872: "Romania",
	7910: "Czech",
	4658: "Lithuania",
	4741: "France",
	4710: "Georgia",
	4554: "Poland",
}
View Source
var HolidayCatalogs = map[int]HolidayCollection{
	8208: {Holiday: hebcal.H_CHANUKAH, Year: 2001},
	8210: {Holiday: hebcal.H_CHANUKAH, Year: 2002},
	8211: {Holiday: hebcal.H_CHANUKAH, Year: 2003},
	8212: {Holiday: hebcal.H_CHANUKAH, Year: 2004},
	8213: {Holiday: hebcal.H_CHANUKAH, Year: 2005},
	8214: {Holiday: hebcal.H_CHANUKAH, Year: 2006},
	8215: {Holiday: hebcal.H_CHANUKAH, Year: 2007},
	8216: {Holiday: hebcal.H_CHANUKAH, Year: 2008},
	8217: {Holiday: hebcal.H_CHANUKAH, Year: 2009},
	8218: {Holiday: hebcal.H_CHANUKAH, Year: 2010},
	8219: {Holiday: hebcal.H_CHANUKAH, Year: 2011},
	8220: {Holiday: hebcal.H_CHANUKAH, Year: 2012},
	8224: {Holiday: hebcal.H_CHANUKAH, Year: 2013},
	8225: {Holiday: hebcal.H_CHANUKAH, Year: 2014},
	8226: {Holiday: hebcal.H_CHANUKAH, Year: 2015},
	8227: {Holiday: hebcal.H_CHANUKAH, Year: 2016},

	8246: {Holiday: hebcal.H_PESACH, Year: 2001},
	8247: {Holiday: hebcal.H_PESACH, Year: 2002},
	8248: {Holiday: hebcal.H_PESACH, Year: 2003},
	8249: {Holiday: hebcal.H_PESACH, Year: 2004},
	8250: {Holiday: hebcal.H_PESACH, Year: 2005},
	8251: {Holiday: hebcal.H_PESACH, Year: 2006},
	8252: {Holiday: hebcal.H_PESACH, Year: 2007},
	8253: {Holiday: hebcal.H_PESACH, Year: 2008},
	8254: {Holiday: hebcal.H_PESACH, Year: 2009},
	8255: {Holiday: hebcal.H_PESACH, Year: 2010},
	8256: {Holiday: hebcal.H_PESACH, Year: 2011},
	8257: {Holiday: hebcal.H_PESACH, Year: 2012},
	8258: {Holiday: hebcal.H_PESACH, Year: 2013},
	8259: {Holiday: hebcal.H_PESACH, Year: 2014},
	8260: {Holiday: hebcal.H_PESACH, Year: 2015},
	8261: {Holiday: hebcal.H_PESACH, Year: 2016},
	8262: {Holiday: hebcal.H_PESACH, Year: 2017},

	8297: {Holiday: hebcal.H_PURIM, Year: 2001},
	8298: {Holiday: hebcal.H_PURIM, Year: 2002},
	8299: {Holiday: hebcal.H_PURIM, Year: 2003},
	8300: {Holiday: hebcal.H_PURIM, Year: 2004},
	8301: {Holiday: hebcal.H_PURIM, Year: 2014},
	8302: {Holiday: hebcal.H_PURIM, Year: 2015},
	8303: {Holiday: hebcal.H_PURIM, Year: 2016},
	8304: {Holiday: hebcal.H_PURIM, Year: 2017},

	8191: {Holiday: hebcal.H_ROSH_HASHANA, Year: 2002},
	8190: {Holiday: hebcal.H_ROSH_HASHANA, Year: 2003},
	8192: {Holiday: hebcal.H_ROSH_HASHANA, Year: 2005},
	8193: {Holiday: hebcal.H_ROSH_HASHANA, Year: 2006},
	8194: {Holiday: hebcal.H_ROSH_HASHANA, Year: 2007},
	8195: {Holiday: hebcal.H_ROSH_HASHANA, Year: 2008},
	8196: {Holiday: hebcal.H_ROSH_HASHANA, Year: 2009},
	8197: {Holiday: hebcal.H_ROSH_HASHANA, Year: 2010},
	8207: {Holiday: hebcal.H_ROSH_HASHANA, Year: 2011},
	8198: {Holiday: hebcal.H_ROSH_HASHANA, Year: 2012},
	8199: {Holiday: hebcal.H_ROSH_HASHANA, Year: 2013},
	8200: {Holiday: hebcal.H_ROSH_HASHANA, Year: 2014},
	8201: {Holiday: hebcal.H_ROSH_HASHANA, Year: 2015},
	8202: {Holiday: hebcal.H_ROSH_HASHANA, Year: 2016},
	8189: {Holiday: hebcal.H_ROSH_HASHANA, Year: 2017},

	8263: {Holiday: hebcal.H_SHAVUOT, Year: 2001},
	8264: {Holiday: hebcal.H_SHAVUOT, Year: 2002},
	8265: {Holiday: hebcal.H_SHAVUOT, Year: 2003},
	8272: {Holiday: hebcal.H_SHAVUOT, Year: 2004},
	8266: {Holiday: hebcal.H_SHAVUOT, Year: 2005},
	8267: {Holiday: hebcal.H_SHAVUOT, Year: 2006},
	8268: {Holiday: hebcal.H_SHAVUOT, Year: 2007},
	8269: {Holiday: hebcal.H_SHAVUOT, Year: 2008},
	8270: {Holiday: hebcal.H_SHAVUOT, Year: 2009},
	8271: {Holiday: hebcal.H_SHAVUOT, Year: 2010},
	8273: {Holiday: hebcal.H_SHAVUOT, Year: 2011},
	8274: {Holiday: hebcal.H_SHAVUOT, Year: 2012},
	8275: {Holiday: hebcal.H_SHAVUOT, Year: 2013},
	8276: {Holiday: hebcal.H_SHAVUOT, Year: 2014},
	8277: {Holiday: hebcal.H_SHAVUOT, Year: 2015},
	8278: {Holiday: hebcal.H_SHAVUOT, Year: 2016},
	8279: {Holiday: hebcal.H_SHAVUOT, Year: 2017},

	8230: {Holiday: hebcal.H_SUKKOT, Year: 2003},
	8242: {Holiday: hebcal.H_SUKKOT, Year: 2004},
	8232: {Holiday: hebcal.H_SUKKOT, Year: 2005},
	8233: {Holiday: hebcal.H_SUKKOT, Year: 2006},
	8234: {Holiday: hebcal.H_SUKKOT, Year: 2007},
	8241: {Holiday: hebcal.H_SUKKOT, Year: 2008},
	8235: {Holiday: hebcal.H_SUKKOT, Year: 2009},
	8236: {Holiday: hebcal.H_SUKKOT, Year: 2010},
	8243: {Holiday: hebcal.H_SUKKOT, Year: 2011},
	8244: {Holiday: hebcal.H_SUKKOT, Year: 2012},
	8237: {Holiday: hebcal.H_SUKKOT, Year: 2013},
	8238: {Holiday: hebcal.H_SUKKOT, Year: 2014},
	8239: {Holiday: hebcal.H_SUKKOT, Year: 2015},
	8240: {Holiday: hebcal.H_SUKKOT, Year: 2016},
	8228: {Holiday: hebcal.H_SUKKOT, Year: 2017},
}
View Source
var HolidayTags = map[string]string{
	hebcal.H_ROSH_HASHANA: "PkEfPB9i",
	hebcal.H_SUKKOT:       "Q2ZFsb9a",
	hebcal.H_CHANUKAH:     "rxNl0zXg",
	hebcal.H_PURIM:        "ZjqGWdYE",
	hebcal.H_PESACH:       "RWqjxgkj",
	hebcal.H_SHAVUOT:      "MyLcuAgH",
}
View Source
var LessonPartsCatalogs = map[int]int{
	4728: -1,
	3630: 0,
	3629: 1,
	3631: 2,
	3632: 3,
	4020: 4,
	4541: 5,
	4841: 6,
	4862: 6,
}

4728 lessons-part 3630 lessons-part/lesson_preparation 3629 lessons-part/lesson_first-part 3631 lessons-part/lesson_second-part 3632 lessons-part/lesson_third-part 4020 lessons-part/lesson_fourth-part 4541 lessons-part/lesson_fifth-part 4841 lessons-part/lesson_six-part 4862 lessons-part/lesson_sixth-part

View Source
var VLCatalogs = []int{
	8154,
	4654,
	27,

	277,
	276,
	1171,
	281,
	278,
	284,
	292,
	279,
	291,
	285,
	283,
	286,
	280,
	288,
	282,
	1376,
	275,
	287,
	2053,
	3559,
	3892,
	4164,
	8017,
	8018,
	8019,
	725,
	213,
	3589,
	3920,
	4760,
	4351,
	4036,
}

Functions

func Compare

func Compare()

func ImportArticles

func ImportArticles()

func ImportClips

func ImportClips()

func ImportCongresses

func ImportCongresses()

func ImportCustom

func ImportCustom()

func ImportFlatCatalogs

func ImportFlatCatalogs()

func ImportHolidays

func ImportHolidays()

func ImportLectures

func ImportLectures()

func ImportMixedLessons

func ImportMixedLessons()

func ImportProgramsChapters

func ImportProgramsChapters()

func ImportVLs

func ImportVLs()

func ImportVirtualLessons

func ImportVirtualLessons()

func Init

func Init() time.Time

func MapUnits

func MapUnits()

func Shutdown

func Shutdown()

func UpdateI18ns

func UpdateI18ns()

Types

type AtomicHistogram

type AtomicHistogram struct {
	sync.RWMutex // Read Write mutex, guards access to internal map
	// contains filtered or unexported fields
}

func NewAtomicHistogram

func NewAtomicHistogram() *AtomicHistogram

func (*AtomicHistogram) Get

func (h *AtomicHistogram) Get() map[string]int

func (*AtomicHistogram) Inc

func (h *AtomicHistogram) Inc(key string, delta int)

type AtomicInt32

type AtomicInt32 struct {
	// contains filtered or unexported fields
}

func (*AtomicInt32) Get

func (a *AtomicInt32) Get() int32

func (*AtomicInt32) Inc

func (a *AtomicInt32) Inc(delta int32)

type Congress

type Congress struct {
	KMediaID    int
	Country     string
	City        string
	FullAddress string
	Name        string
	StartDate   time.Time
	EndDate     time.Time
	Year        int
	Month       int
	Events      []EventPart
	Catalog     *kmodels.Catalog
}

type ContentTypeGrouper added in v1.0.9

type ContentTypeGrouper struct {
	TypeID int
}

func NewContentTypeGrouper added in v1.0.9

func NewContentTypeGrouper(typeID int) *ContentTypeGrouper

func (*ContentTypeGrouper) Match added in v1.0.9

func (g *ContentTypeGrouper) Match(cn *kmodels.Container) bool

func (*ContentTypeGrouper) String added in v1.0.9

func (g *ContentTypeGrouper) String() string

type EventPart

type EventPart struct {
	KMediaID  int
	Name      string
	Position  int
	Container *kmodels.Container
}

type FileMappings

type FileMappings struct {
	Sha1              string
	KMediaID          int
	KMediaContainerID int
	MdbExists         bool
	MdbID             int64
	MdbUnitID         int64
	MdbKMediaID       int
}

type Grouper added in v1.0.9

type Grouper interface {
	Match(*kmodels.Container) bool
	String() string
}

type HolidayCollection

type HolidayCollection struct {
	Holiday string
	Year    int
}

type ImportSettings

type ImportSettings struct {
	CT             string
	SubCT          string
	CollectionUIDs []string
	KmCNID         int
}

type ImportStatistics

type ImportStatistics struct {
	LessonsProcessed       AtomicInt32
	ValidLessons           AtomicInt32
	InvalidLessons         AtomicInt32
	CatalogsProcessed      AtomicInt32
	ContainersProcessed    AtomicInt32
	ContainersVisited      AtomicInt32
	ContainersWithFiles    AtomicInt32
	ContainersWithoutFiles AtomicInt32
	FileAssetsProcessed    AtomicInt32
	FileAssetsMissingSHA1  AtomicInt32
	FileAssetsWInvalidMT   AtomicInt32
	FileAssetsMissingType  AtomicInt32

	OperationsCreated   AtomicInt32
	CollectionsCreated  AtomicInt32
	CollectionsUpdated  AtomicInt32
	ContentUnitsCreated AtomicInt32
	ContentUnitsUpdated AtomicInt32
	FilesCreated        AtomicInt32
	FilesUpdated        AtomicInt32

	TxCommitted  AtomicInt32
	TxRolledBack AtomicInt32

	UnkownCatalogs AtomicHistogram
}

func NewImportStatistics

func NewImportStatistics() *ImportStatistics

type PredicateGrouper added in v1.0.9

type PredicateGrouper struct {
	// contains filtered or unexported fields
}

func NewPredicateGrouper added in v1.0.9

func NewPredicateGrouper(name string, fn func(cn *kmodels.Container) bool) *PredicateGrouper

func (*PredicateGrouper) Match added in v1.0.9

func (g *PredicateGrouper) Match(cn *kmodels.Container) bool

func (*PredicateGrouper) String added in v1.0.9

func (g *PredicateGrouper) String() string

type RegexGrouper added in v1.0.9

type RegexGrouper struct {
	// contains filtered or unexported fields
}

func NewRegexGrouper added in v1.0.9

func NewRegexGrouper(name, re string) *RegexGrouper

func (*RegexGrouper) Match added in v1.0.9

func (g *RegexGrouper) Match(cn *kmodels.Container) bool

func (*RegexGrouper) String added in v1.0.9

func (g *RegexGrouper) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL