MCPcopy Create free account
hub / github.com/MALSync/MALSync / offsetHandler

Method offsetHandler

src/pages-sync/syncPage.ts:937–961  ·  view source on GitHub ↗
(epList)

Source from the content-addressed store, hash-verified

935 }
936
937 offsetHandler(epList) {
938 if (!this.page.overview!.list!.offsetHandler) return;
939 if (this.getOffset()) return;
940 if (!this.searchObj || this.searchObj.provider === 'user') return;
941 for (let i = 0; i < epList.length; ++i) {
942 if (typeof epList[i] !== 'undefined') {
943 logger.log('Offset', i);
944 if (i > 1) {
945 const calcOffset = 1 - i;
946 utils.flashConfirm(
947 api.storage.lang('syncPage_flashConfirm_offsetHandler_1', [String(calcOffset)]),
948 'offset',
949 () => {
950 this.setOffset(calcOffset);
951 },
952 () => {
953 this.setOffset(0);
954 },
955 true,
956 );
957 }
958 return;
959 }
960 }
961 }
962
963 protected imageFallbackInterval: NodeJS.Timeout | undefined = undefined;
964

Callers 1

handleListMethod · 0.95

Calls 3

getOffsetMethod · 0.95
setOffsetMethod · 0.95
langMethod · 0.80

Tested by

no test coverage detected