public String getShowviewNumberFor(Channel channel, int year, int month, int day, int hour, int minute, int length) throws TvBrowserException {
year %= 100;
int minDiff = minute % 5;
minute -= minDiff;
length += minDiff;
int channelNumber = ShowviewChannelTable.getChannelNumberFor(channel);
if (channelNumber == -1) {
throw new TvBrowserException(class$showviewplugin$ShowviewEncoder == null ? (class$showviewplugin$ShowviewEncoder = class$("showviewplugin.ShowviewEncoder")) : class$showviewplugin$ShowviewEncoder, "error.1", "Didn't find a showview channel number (Leitzahl) for {0}", channel);
} else {
if (channelNumber == 26) {
channelNumber += 18;
} else if (channelNumber == 109) {
channelNumber -= 59;
} else {
if (channelNumber >= 19) {
throw new TvBrowserException(class$showviewplugin$ShowviewEncoder == null ? (class$showviewplugin$ShowviewEncoder = class$("showviewplugin.ShowviewEncoder")) : class$showviewplugin$ShowviewEncoder, "error.2", "Calculation does not work for this program");
}
--channelNumber;
}
int timeIndex = ShowviewTimeTable.getInstance().getBestFit(hour, minute, length);
throw new TvBrowserException(class$showviewplugin$ShowviewEncoder == null ? (class$showviewplugin$ShowviewEncoder = class$("showviewplugin.ShowviewEncoder")) : class$showviewplugin$ShowviewEncoder, "error.2", "Calculation does not work for this program");
int newNumber = this.calculateNewNumber(day, top, newtopLength, i);
offset += newNumber % 10;
}
++doLoopCount;
if (doLoopCount > 100) {
throw new TvBrowserException(class$showviewplugin$ShowviewEncoder == null ? (class$showviewplugin$ShowviewEncoder = class$("showviewplugin.ShowviewEncoder")) : class$showviewplugin$ShowviewEncoder, "error.2", "Calculation does not work for this program");
}
} while(this.getLength(top) < newtopLength);
for(int i = 0; i < topArr.length; ++i) {
offset += topArr[i];
}
int rem = this.saveMod(top2 - day * (month + 1) - offset, 32);
throw new TvBrowserException(class$showviewplugin$ShowviewEncoder == null ? (class$showviewplugin$ShowviewEncoder = class$("showviewplugin.ShowviewEncoder")) : class$showviewplugin$ShowviewEncoder, "error.2", "Calculation does not work for this program");
}
} while(showviewArr[0] == 0);
int showview = this.mergeDigits(showviewArr);
if (minDiff != 0) {
showview += minDiff * 100000000;
}
StringBuffer buffer = new StringBuffer();
showviewArr = this.splitDigits(showview);
for(int i = 0; i < showviewArr.length; ++i) {
buffer.append(showviewArr[i]);
int digit = showviewArr.length - i - 1;
if (digit > 0 && digit % 3 == 0) {
buffer.append('-');
}
}
return buffer.toString();
}
}
}
private int calculateNewNumber(int day, int top, int newtopLength, int repeatCount) {