wavelength 1.0.0
Loading...
Searching...
No Matches
uploadinfo.h
Go to the documentation of this file.
1#pragma once
2
3#ifdef VIDEO_STANDARD_PAL
4
5#include <cstring>
6
7#include "os/string.h"
8
16struct UploadInfo {
17 String mName;
18 int mInRepos = 0;
19};
20
22constexpr int kUploadDateSize = 7;
23
25constexpr int kUploadPartSize = 30;
26
39inline void SplitUploadName(const char *pszName, char *pszDate, char *pszSong, char *pszTitle) {
40 constexpr int kPrefixLength = 2;
41 constexpr int kDateLength = 6;
42 constexpr int kSeparatorLength = 1;
43 constexpr int kShadesSongLength = 15;
44 const char *p = pszName + kPrefixLength;
45 std::strncpy(pszDate, p, kDateLength);
46 p += kDateLength + kSeparatorLength;
47 const size_t nSong = std::strcspn(p, "_");
48 std::strncpy(pszSong, p, nSong);
49 if (std::strcmp(pszSong, "SHADES") == 0) {
50 p += kShadesSongLength;
51 std::strcpy(pszSong, "SHADES_OF");
52 } else {
53 p += nSong + kSeparatorLength;
54 }
55 std::strncpy(pszTitle, p, std::strcspn(p, "."));
56}
57
58#endif